diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f025bae5be..e4e26c8f0f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -99,7 +99,7 @@ repos: name: API Spec Codegen additional_dependencies: - uv==0.7.8 - entry: sh -c 'uv run ./docs/openapi_generator/run_openapi_generator.sh > /dev/null' + entry: sh -c 'uv run python3 -c "from docs.openapi_generator.fastapi_generator import generate_openapi_spec; generate_openapi_spec(\"docs/static\")" > /dev/null' language: python pass_filenames: false require_serial: true diff --git a/client-sdks/stainless/openapi.yml b/client-sdks/stainless/openapi.yml index d992b72eb5..aefc6ff4ba 100644 --- a/client-sdks/stainless/openapi.yml +++ b/client-sdks/stainless/openapi.yml @@ -37,36 +37,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: @@ -75,9 +83,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': @@ -96,12 +103,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}: @@ -130,13 +138,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: @@ -165,12 +176,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: @@ -199,6 +211,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: @@ -233,13 +250,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: @@ -266,13 +286,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: @@ -305,13 +330,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: @@ -339,57 +367,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: @@ -416,13 +436,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: @@ -438,7 +462,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ConversationItem' + id: Annotated '400': $ref: '#/components/responses/BadRequest400' '429': @@ -456,19 +480,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: @@ -495,19 +523,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: @@ -537,12 +569,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: @@ -572,9 +605,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 @@ -583,29 +626,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: @@ -634,14 +678,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: @@ -688,14 +737,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: @@ -719,15 +771,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: @@ -756,14 +812,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: @@ -792,6 +851,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: @@ -821,6 +882,8 @@ paths: List routes. List all available API routes with their methods and implementing providers. + + :returns: Response containing information about all available routes. parameters: [] deprecated: false /v1/models: @@ -845,7 +908,10 @@ paths: tags: - Models summary: List all models. - description: List all models. + description: >- + List all models. + + :returns: A ListModelsResponse. parameters: [] deprecated: false post: @@ -873,6 +939,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: @@ -907,13 +980,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: @@ -936,14 +1012,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: @@ -971,6 +1049,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: @@ -1002,7 +1086,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: @@ -1030,6 +1117,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: @@ -1064,20 +1156,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: @@ -1105,13 +1201,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: @@ -1140,13 +1244,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: @@ -1175,13 +1281,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: @@ -1216,14 +1326,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: @@ -1252,6 +1365,9 @@ paths: List providers. List all available providers. + + :returns: A ListProvidersResponse containing information about all + providers. parameters: [] deprecated: false /v1/providers/{provider_id}: @@ -1281,13 +1397,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: @@ -1311,33 +1430,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: @@ -1349,7 +1476,7 @@ paths: $ref: '#/components/schemas/OpenAIResponseObject' text/event-stream: schema: - $ref: '#/components/schemas/OpenAIResponseObjectStream' + $ref: '#/components/schemas/AsyncIterator' '400': $ref: '#/components/responses/BadRequest400' '429': @@ -1363,7 +1490,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: @@ -1375,15 +1516,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: @@ -1406,15 +1543,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: @@ -1437,14 +1578,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: @@ -1468,53 +1613,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: @@ -1542,6 +1695,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: @@ -1572,7 +1730,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: @@ -1592,7 +1753,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: @@ -1623,14 +1795,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: @@ -1649,15 +1825,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: @@ -1682,7 +1861,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: @@ -1713,7 +1897,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: @@ -1744,7 +1934,10 @@ paths: tags: - Shields summary: List all shields. - description: List all shields. + description: >- + List all shields. + + :returns: A ListShieldsResponse. parameters: [] deprecated: false post: @@ -1768,7 +1961,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: @@ -1799,14 +1999,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: @@ -1825,15 +2029,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/synthetic-data-generation/generate: post: @@ -1861,6 +2068,15 @@ paths: 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: @@ -1891,7 +2107,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: @@ -1922,22 +2143,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: @@ -1960,6 +2186,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: @@ -1994,6 +2226,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: @@ -2024,7 +2262,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: @@ -2044,7 +2285,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: @@ -2075,14 +2322,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: @@ -2101,14 +2352,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: @@ -2132,15 +2386,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: @@ -2164,14 +2422,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: @@ -2191,7 +2453,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: @@ -2222,7 +2496,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: @@ -2254,40 +2534,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: @@ -2315,12 +2607,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}: @@ -2346,14 +2639,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: @@ -2377,14 +2674,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: @@ -2414,14 +2719,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: @@ -2451,19 +2760,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}: @@ -2489,21 +2802,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: @@ -2528,21 +2847,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: @@ -2571,60 +2897,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: @@ -2649,55 +2991,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: @@ -2721,15 +3077,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: @@ -2760,21 +3124,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: @@ -2798,21 +3168,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: @@ -2842,21 +3220,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: @@ -2884,20 +3269,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: @@ -2927,13 +3317,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: @@ -2968,6 +3372,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}: @@ -2988,15 +3394,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: @@ -3031,38 +3441,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. + The response includes: + - data: List of items for the current page. + - has_more: Whether there are more items available after this set. - - 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 - 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: @@ -3086,7 +3498,10 @@ paths: tags: - Datasets summary: List all datasets. - description: List all datasets. + description: >- + List all datasets. + + :returns: A ListDatasetsResponse. parameters: [] deprecated: false post: @@ -3110,7 +3525,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: @@ -3141,14 +3620,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: @@ -3167,14 +3650,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: @@ -3198,20 +3684,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: @@ -3238,6 +3729,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: @@ -3268,14 +3762,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: @@ -3297,13 +3795,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: @@ -3327,15 +3827,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: @@ -3365,30 +3870,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: @@ -3410,35 +3920,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': @@ -3452,22 +3963,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: @@ -3497,27 +4023,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: @@ -3532,7 +4064,7 @@ paths: $ref: '#/components/schemas/Turn' text/event-stream: schema: - $ref: '#/components/schemas/AgentTurnResponseStreamChunk' + $ref: '#/components/schemas/AsyncIterator' '400': $ref: '#/components/responses/BadRequest400' '429': @@ -3553,25 +4085,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: @@ -3601,33 +4142,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: @@ -3651,27 +4199,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: @@ -3695,7 +4249,10 @@ paths: tags: - Benchmarks summary: List all benchmarks. - description: List all benchmarks. + description: >- + List all benchmarks. + + :returns: A ListBenchmarksResponse. parameters: [] deprecated: false post: @@ -3715,7 +4272,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: @@ -3746,14 +4312,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: @@ -3772,14 +4342,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: @@ -3804,15 +4377,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: @@ -3843,15 +4423,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: @@ -3881,21 +4466,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: @@ -3914,21 +4504,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: @@ -3952,21 +4546,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: @@ -3994,6 +4593,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: @@ -4024,15 +4634,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: @@ -4052,7 +4666,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: @@ -4083,15 +4700,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: @@ -4115,7 +4736,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: @@ -4140,7 +4764,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: @@ -4171,7 +4804,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: @@ -4185,1088 +4828,1477 @@ 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 - detail title: Error - description: >- - Error response from the API. Roughly follows RFC 7807. + type: object Order: - type: string - enum: - - asc - - desc - title: Order - 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 + 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 - 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 - 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 + - type: 'null' + title: File Id + filename: + anyOf: + - type: string + - type: 'null' + title: Filename + title: OpenAIFileFile + type: object + OpenAIImageURL: description: >- - The model that was used to generate the chat completion - usage: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' + 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: >- - 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: - type: object - 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 + 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 model that was used to generate the chat completion - usage: - $ref: '#/components/schemas/OpenAIChatCompletionUsage' + 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: >- - 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 + 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 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' + 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 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: - type: object + 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 + anyOf: + - $ref: '#/$defs/OpenAIChatCompletionUsage' + - type: 'null' input_messages: - type: array items: - $ref: '#/components/schemas/OpenAIMessageParam' - additionalProperties: false + 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 - 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 + OpenAICompletion: + $defs: + OpenAIChoiceLogprobs: description: >- - (Optional) The penalty for repeated tokens. - logit_bias: + 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 - 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 + OpenAICompletionChoice: description: >- - (Optional) The number of completions to generate. - presence_penalty: - type: number + 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: >- - (Optional) The penalty for repeated tokens. - seed: - type: integer - description: (Optional) The seed to use. - stop: - 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: - type: string - description: (Optional) The stop tokens to use. - stream: - type: boolean - description: >- - (Optional) Whether to stream the response. - stream_options: + $ref: '#/$defs/OpenAITopLogProb' + title: Top Logprobs + type: array + required: + - token + - logprob + - top_logprobs + title: OpenAITokenLogProb 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 + OpenAITopLogProb: description: >- - (Optional) The suffix that should be appended to the completion. - additionalProperties: false - required: - - model - - prompt - title: OpenAICompletionRequestWithExtraBody + 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: >- - Request parameters for OpenAI-compatible completion endpoint. - OpenAICompletion: - type: object + 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: - type: array items: - $ref: '#/components/schemas/OpenAICompletionChoice' + $ref: '#/$defs/OpenAICompletionChoice' + title: Choices + type: array created: + title: Created type: integer model: + title: Model type: string object: - type: string const: text_completion default: text_completion - additionalProperties: false + title: Object + type: string required: - id - choices - created - model - - object title: OpenAICompletion - description: >- - Response from an OpenAI-compatible completion request. - OpenAICompletionChoice: type: object properties: finish_reason: @@ -5920,779 +6952,1671 @@ components: Web search tool call output message for OpenAI responses. CreateConversationRequest: type: object + Conversation: + description: OpenAI-compatible conversation object. properties: - items: - type: array - items: - $ref: '#/components/schemas/ConversationItem' + id: + description: The unique ID of the conversation. + title: Id + type: string + object: + const: conversation + default: conversation 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 - properties: - id: - type: string - object: + The object type, which is always conversation. + title: Object type: string - const: conversation - default: conversation 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 + ConversationItemList: + $defs: + MCPListToolsTool: 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 + 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: >- - 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 + 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) The format to return the embeddings in. Can be either "float" - or "base64". Defaults to "float". - dimensions: - 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: >- - (Optional) The number of dimensions the resulting output embeddings should - have. Only supported in text-embedding-3 and later models. - user: - type: string + 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: >- - (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 + 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: >- - The object type, which will be "embedding" - embedding: - oneOf: - - type: array - items: - type: number - - 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: >- - 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 + 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: >- - 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 + 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 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 + 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: >- - Valid purpose values for OpenAI Files API. - ListOpenAIFileResponse: - 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/OpenAIFileObject' - description: List of file objects - has_more: - type: boolean - description: >- - Whether there are more files available beyond this page + 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: - type: string - description: >- - ID of the first file in the list for pagination + anyOf: + - type: string + - type: 'null' + description: The ID of the first item in the list + title: First Id 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 + 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 - - has_more - - first_id - - last_id - - object - title: ListOpenAIFileResponse - description: >- - Response for listing files in OpenAI Files API. - OpenAIFileObject: + title: ConversationItemList + type: object + AddItemsRequest: type: object + ConversationItemDeletedResource: + description: Response for deleted conversation item. properties: - object: - type: string - const: file - default: file - description: The object type, which is always "file" id: + description: The deleted item identifier + title: 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: + object: + default: conversation.item.deleted + description: Object type + title: Object type: string - enum: - - assistants - - batch - description: The intended purpose of the file - additionalProperties: false + deleted: + default: true + description: Whether the object was deleted + title: Deleted + type: boolean required: - - object - id - - bytes - - created_at - - expires_at - - filename - - purpose - title: OpenAIFileObject - description: >- - OpenAI File object as defined in the OpenAI Files API. - ExpiresAfter: + title: ConversationItemDeletedResource type: object - properties: - anchor: - type: string - const: created_at - seconds: - type: integer - additionalProperties: false + 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: - - anchor - - seconds - title: ExpiresAfter + - 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) - OpenAIFileDeleteResponse: + 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 - description: The file identifier that was deleted object: - type: string const: file default: file - description: The object type, which is always "file" + title: Object + type: string deleted: + title: 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. + type: object Response: type: object - title: Response HealthInfo: - type: object - properties: - status: - type: string + $defs: + HealthStatus: enum: - OK - Error - Not Implemented - description: Current health status of the service - additionalProperties: false + 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 - 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 + ListRoutesResponse: + $defs: + RouteInfo: description: >- - List of provider types that implement this route - additionalProperties: false - required: - - route - - method - - provider_types - title: RouteInfo + 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: >- - Information about an API route including its path, method, and implementing - providers. - ListRoutesResponse: - type: object + Response containing a list of all available API routes. + + + :param data: List of available route information objects properties: data: - type: array items: - $ref: '#/components/schemas/RouteInfo' - description: >- - List of available route information objects - additionalProperties: false + $ref: '#/$defs/RouteInfo' + title: Data + type: array required: - data title: ListRoutesResponse - description: >- - Response containing a list of all available API routes. - Model: type: object - properties: - identifier: - type: string + ListModelsResponse: + $defs: + Model: description: >- - Unique identifier for this resource in llama stack - provider_resource_id: - type: string + 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 + 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: model + default: model + title: Type + type: string + metadata: + additionalProperties: true + description: Any additional metadata for this model + title: Metadata + type: object + model_type: + $ref: '#/$defs/ModelType' + default: llm + required: + - identifier + - provider_id + title: Model + type: object + ModelType: description: >- - Unique identifier for this resource in the provider - provider_id: + 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 + enum: + - llm + - embedding + - rerank + title: ModelType 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. - ModelType: - type: string - enum: - - llm - - embedding - - rerank - title: ModelType - description: >- - Enumeration of supported model types in Llama Stack. - ListModelsResponse: - type: object properties: data: - type: array items: - $ref: '#/components/schemas/Model' - additionalProperties: false + $ref: '#/$defs/Model' + title: Data + type: array required: - data title: ListModelsResponse + type: object RegisterModelRequest: type: object - properties: - model_id: + Model: + $defs: + 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 + enum: + - llm + - embedding + - rerank + title: ModelType type: string - description: The identifier of the model to register. - provider_model_id: + 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 + properties: + identifier: + description: >- + Unique identifier for this resource in llama stack + title: Identifier type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' description: >- - The identifier of the model in the provider. + 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: model + default: model + title: Type type: string - description: The identifier of the provider. metadata: + additionalProperties: true + description: Any additional metadata for this model + title: 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 + $ref: '#/$defs/ModelType' + default: llm required: - - model_id - title: RegisterModelRequest + - identifier + - provider_id + title: Model + type: object 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 ModerationObject: - type: object + $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 - description: >- - The unique identifier for the moderation request. model: + title: Model type: string - 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 + $ref: '#/$defs/ModerationObjectResults' + title: Results + type: array required: - 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. - categories: - type: object - additionalProperties: - type: boolean + ListPromptsResponse: + $defs: + Prompt: description: >- - A list of the categories, and whether they are flagged or not. - category_applied_input_types: - type: object - additionalProperties: - type: array - items: + 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 - 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. - user_message: - type: string - metadata: + 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 - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - additionalProperties: false + description: Response model to list prompts. + properties: + data: + items: + $ref: '#/$defs/Prompt' + title: Data + type: array required: - - flagged - - metadata - title: ModerationObjectResults - description: A moderation object. - Prompt: + - 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: - type: string + anyOf: + - type: string + - type: 'null' description: >- - The system prompt text with variable placeholders. Variables are only - supported when using the Responses API. + The system prompt with variable placeholders + title: Prompt version: - type: integer description: >- Version (integer starting at 1, incremented on save) + minimum: 1 + title: Version + type: integer prompt_id: - type: string description: >- - Unique identifier formatted as 'pmpt_<48-digit-hash>' + Unique identifier in format 'pmpt_<48-digit-hash>' + title: Prompt Id + type: string variables: - type: array + description: >- + List of variable names that can be used in the prompt template items: type: string - description: >- - List of prompt variable names that can be used in the prompt template + title: Variables + type: array is_default: - type: boolean default: false description: >- - Boolean indicating whether this version is the default version for this - prompt - additionalProperties: false + Boolean indicating whether this version is the default version + title: Is Default + type: boolean 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 + 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: - type: array items: - $ref: '#/components/schemas/Prompt' - additionalProperties: false + $ref: '#/$defs/ProviderInfo' + title: Data + type: array required: - data - title: ListPromptsResponse - description: Response model to list prompts. - CreatePromptRequest: + 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: - prompt: + api: + title: Api 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: - type: object - properties: - prompt: + provider_id: + title: Provider 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: - 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: - 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: + title: Provider Type type: string - description: The type of provider implementation config: + additionalProperties: true + title: Config type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - Configuration parameters for the provider health: + additionalProperties: true + title: 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 @@ -6700,5470 +8624,8937 @@ components: - config - health title: ProviderInfo - description: >- - Information about a registered provider including its configuration and health - status. - ListProvidersResponse: 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 - properties: - data: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseObjectWithInput' + $defs: + AllowedToolsFilter: 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: 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 - required: - - data - - has_more - - first_id - - last_id - - object - title: ListOpenAIResponseObject - description: >- - Paginated list of OpenAI response objects with navigation metadata. - OpenAIResponseError: - type: object - properties: - code: - type: string + 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: >- - Error code identifying the type of failure - message: - 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: >- - 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: - type: string - const: file_search - default: file_search + 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: >- - Tool type identifier, always "file_search" - vector_store_ids: - type: array - items: - 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: >- - List of vector store identifiers to search within - filters: + 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 - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + OpenAIResponseError: description: >- - (Optional) Additional filters to apply to the search - max_num_results: - type: integer - default: 10 + 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: >- - (Optional) Maximum number of search results to return (1-50) - ranking_options: + 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: - ranker: + 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 - 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 + image_url: + anyOf: + - type: string + - type: 'null' + title: Image Url + title: OpenAIResponseInputMessageContentImage + type: object + OpenAIResponseInputMessageContentText: 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: - 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: + 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 - 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: - type: string - default: medium + OpenAIResponseInputToolFileSearch: 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 + 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: >- - Unix timestamp when the response was created - error: - $ref: '#/components/schemas/OpenAIResponseError' + 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: >- - (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 + 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: >- - Object type identifier, always "response" - output: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseOutput' + 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: >- - List of generated output items (messages, tool calls, etc.) - parallel_tool_calls: - type: boolean - default: false + 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: >- - Whether tool calls can be executed in parallel - previous_response_id: - type: string + 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) ID of the previous response in a conversation - prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' + 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) 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: - 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 - 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 - 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: - 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 - 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 - 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: - 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 - 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: - - input - - model - title: CreateOpenaiResponseRequest - OpenAIResponseObject: - 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: - 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: - 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: - type: object - 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 - items: - $ref: '#/components/schemas/OpenAIResponseAnnotations' - description: >- - Structured annotations associated with the text - logprobs: - type: array - items: - 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: 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 - 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": - 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 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: - 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: - 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": - 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 - 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: - 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": - 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: - 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": - type: object - 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: - 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.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 - 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: - type: string - const: response.in_progress - default: response.in_progress + 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: >- - 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' + 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: >- - Response object describing the incomplete state - 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.incomplete - default: response.incomplete + 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.incomplete" - additionalProperties: false - required: - - response - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseIncomplete - 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": - type: object - properties: - arguments: - type: string - item_id: - type: string - output_index: - type: integer - sequence_number: - type: integer - type: - 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 + 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 - type: - type: string - const: response.mcp_call.completed - default: response.mcp_call.completed + 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: >- - Event type identifier, always "response.mcp_call.completed" - additionalProperties: false - required: - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpCallCompleted - description: Streaming event for completed MCP calls. - "OpenAIResponseObjectStreamResponseMcpCallFailed": - type: object - properties: - sequence_number: - type: integer + 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: >- - Sequential number for ordering streaming events - type: - type: string - const: response.mcp_call.failed - default: response.mcp_call.failed + 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: >- - Event type identifier, always "response.mcp_call.failed" - additionalProperties: false - required: - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpCallFailed - description: Streaming event for failed MCP calls. - "OpenAIResponseObjectStreamResponseMcpCallInProgress": - type: object - properties: - item_id: - type: string - description: Unique identifier of the MCP call - 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 item in the output list - 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.mcp_call.in_progress - default: response.mcp_call.in_progress + 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.mcp_call.in_progress" - additionalProperties: false - required: - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpCallInProgress + 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 MCP calls in progress. - "OpenAIResponseObjectStreamResponseMcpListToolsCompleted": - type: object - 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": - type: object - 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": - 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: - sequence_number: - type: integer - type: + data: + items: + $ref: '#/$defs/OpenAIResponseObjectWithInput' + title: Data + type: array + has_more: + title: Has More + type: boolean + first_id: + title: First Id 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": - type: object - properties: - response_id: + last_id: + title: Last 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 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: + object: + const: list + default: list + title: Object 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": + - data + - has_more + - first_id + - last_id + title: ListOpenAIResponseObject type: object properties: - response_id: + code: 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: + Error code identifying the type of failure + message: type: string - const: response.output_item.done - default: response.output_item.done description: >- - Event type identifier, always "response.output_item.done" + Human-readable error message describing the failure additionalProperties: false required: - - response_id - - item - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseOutputItemDone + - code + - message + title: OpenAIResponseError description: >- - Streaming event for when an output item is completed. - "OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded": + 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 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 + Tool type identifier, always "file_search" + vector_store_ids: + type: array + items: + type: string description: >- - Index position of the content part within the output item - annotation_index: - type: integer + 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 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: + (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.output_text.annotation.added - default: response.output_text.annotation.added + (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.output_text.annotation.added" + (Optional) Options for ranking and scoring search results additionalProperties: false required: - - item_id - - output_index - - content_index - - annotation_index - - annotation - - sequence_number - type - title: >- - OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded + - vector_store_ids + title: OpenAIResponseInputToolFileSearch description: >- - Streaming event for when an annotation is added to output text. - "OpenAIResponseObjectStreamResponseOutputTextDelta": + File search tool configuration for OpenAI response inputs. + OpenAIResponseInputToolFunction: type: object properties: - content_index: - type: integer - description: Index position within the text content - delta: + type: type: string - description: Incremental text content being added - item_id: + 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 output item being updated - 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.output_text.delta - default: response.output_text.delta + (Optional) JSON schema defining the function's parameters + strict: + type: boolean description: >- - Event type identifier, always "response.output_text.delta" + (Optional) Whether to enforce strict parameter validation additionalProperties: false required: - - content_index - - delta - - item_id - - output_index - - sequence_number - type - title: >- - OpenAIResponseObjectStreamResponseOutputTextDelta + - name + title: OpenAIResponseInputToolFunction description: >- - Streaming event for incremental text content updates. - "OpenAIResponseObjectStreamResponseOutputTextDone": + Function tool configuration for OpenAI response inputs. + OpenAIResponseInputToolWebSearch: type: object properties: - content_index: - type: integer - description: Index position within the text content - text: - type: string - description: >- - Final complete text content of the output item - 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: + 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.output_text.done - default: response.output_text.done + default: medium description: >- - Event type identifier, always "response.output_text.done" + (Optional) Size of search context, must be "low", "medium", or "high" additionalProperties: false required: - - content_index - - text - - item_id - - output_index - - sequence_number - type - title: >- - OpenAIResponseObjectStreamResponseOutputTextDone + title: OpenAIResponseInputToolWebSearch description: >- - Streaming event for when text output is completed. - "OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded": + Web search tool configuration for OpenAI response inputs. + OpenAIResponseObjectWithInput: 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: + created_at: type: integer description: >- - Sequential number for ordering streaming events - summary_index: - type: integer + Unix timestamp when the response was created + error: + $ref: '#/components/schemas/OpenAIResponseError' description: >- - Index of the summary part within the reasoning summary - type: + (Optional) Error details if the response generation failed + id: 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: + description: Unique identifier for this response + model: 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: Model identifier used for generation + object: + type: string + const: response + default: response description: >- - Sequential number for ordering streaming events - summary_index: - type: integer + Object type identifier, always "response" + output: + type: array + items: + $ref: '#/components/schemas/OpenAIResponseOutput' 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 + List of generated output items (messages, tool calls, etc.) + parallel_tool_calls: + type: boolean + default: false 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": - type: object - properties: - delta: - type: string - description: Incremental summary text being added - item_id: + Whether tool calls can be executed in parallel + previous_response_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 + (Optional) ID of the previous response in a conversation + prompt: + $ref: '#/components/schemas/OpenAIResponsePrompt' description: >- - Index of the summary part within the reasoning summary - type: + (Optional) Reference to a prompt template and its variables. + status: 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: + 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: 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 + (Optional) Truncation strategy applied to the response + usage: + $ref: '#/components/schemas/OpenAIResponseUsage' description: >- - Index of the summary part within the reasoning summary - type: + (Optional) Token usage information for the response + instructions: type: string - const: response.reasoning_summary_text.done - default: response.reasoning_summary_text.done description: >- - Event type identifier, always "response.reasoning_summary_text.done" + (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 - - item_id - - output_index - - sequence_number - - summary_index - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningSummaryTextDone + - input + title: OpenAIResponseObjectWithInput description: >- - Streaming event for when reasoning summary text is completed. - "OpenAIResponseObjectStreamResponseReasoningTextDelta": + 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: - content_index: - type: integer - description: >- - Index position of the reasoning content part - delta: - type: string - description: Incremental reasoning text being added - item_id: + id: type: string + description: Unique identifier of the prompt template + variables: + type: object + additionalProperties: + $ref: '#/components/schemas/OpenAIResponseInputMessageContent' 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: + 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.reasoning_text.delta - default: response.reasoning_text.delta description: >- - Event type identifier, always "response.reasoning_text.delta" + Version number of the prompt to use (defaults to latest if not specified) additionalProperties: false required: - - content_index - - delta - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningTextDelta + - id + title: OpenAIResponsePrompt description: >- - Streaming event for incremental reasoning text updates. - "OpenAIResponseObjectStreamResponseReasoningTextDone": + OpenAI compatible Prompt object that is used in OpenAI responses. + OpenAIResponseText: type: object properties: - content_index: - type: integer - description: >- - Index position of the reasoning content part - 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 + 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.reasoning_text.done" + (Optional) Text format configuration specifying output format requirements additionalProperties: false - required: - - content_index - - text - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseReasoningTextDone + title: OpenAIResponseText description: >- - Streaming event for when reasoning text is completed. - "OpenAIResponseObjectStreamResponseRefusalDelta": + 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: - 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 + 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.refusal.delta" + (Optional) Restriction on which tools can be used from this server additionalProperties: false required: - - content_index - - delta - - item_id - - output_index - - sequence_number - type - title: >- - OpenAIResponseObjectStreamResponseRefusalDelta + - server_label + title: OpenAIResponseToolMCP description: >- - Streaming event for incremental refusal text updates. - "OpenAIResponseObjectStreamResponseRefusalDone": + Model Context Protocol (MCP) tool configuration for OpenAI response object. + OpenAIResponseUsage: type: object properties: - content_index: + input_tokens: 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: + description: Number of tokens in the input + output_tokens: type: integer - description: >- - Index position of the item in the output list - sequence_number: + description: Number of tokens in the output + total_tokens: 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" + 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: - - content_index - - refusal - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseRefusalDone - description: >- - Streaming event for when refusal text is completed. - "OpenAIResponseObjectStreamResponseWebSearchCallCompleted": + - input_tokens + - output_tokens + - total_tokens + title: OpenAIResponseUsage + description: Usage information for OpenAI response. + ResponseGuardrailSpec: 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 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" + description: The type/identifier of the guardrail. additionalProperties: false required: - - item_id - - output_index - - sequence_number - type - title: >- - OpenAIResponseObjectStreamResponseWebSearchCallCompleted + title: ResponseGuardrailSpec description: >- - Streaming event for completed web search calls. - "OpenAIResponseObjectStreamResponseWebSearchCallInProgress": + 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: - item_id: + type: type: string - description: Unique identifier of the web search call - output_index: - type: integer + 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: >- - Index position of the item in the output list - sequence_number: - type: integer + (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: >- - Sequential number for ordering streaming events - type: - type: string - const: response.web_search_call.in_progress - default: response.web_search_call.in_progress + 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: >- - Event type identifier, always "response.web_search_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: >- - OpenAIResponseObjectStreamResponseWebSearchCallInProgress + - server_label + - server_url + - require_approval + title: OpenAIResponseInputToolMCP description: >- - Streaming event for web search calls in progress. - "OpenAIResponseObjectStreamResponseWebSearchCallSearching": + Model Context Protocol (MCP) tool configuration for OpenAI response inputs. + CreateOpenaiResponseRequest: type: object properties: - item_id: + input: + oneOf: + - type: string + - type: array + items: + $ref: '#/components/schemas/OpenAIResponseInput' + description: Input message(s) to create the response. + model: type: string - output_index: - type: integer - sequence_number: - type: integer - type: + description: The underlying LLM used for completions. + prompt: + $ref: '#/components/schemas/OpenAIResponsePrompt' + description: >- + (Optional) Prompt object with ID, version, and variables. + instructions: 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: + previous_response_id: type: string description: >- - Unique identifier of the deleted response - object: + (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 - default: response description: >- - Object type identifier, always "response" - deleted: + (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 - 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: + stream: + type: boolean + temperature: + type: number + text: + $ref: '#/components/schemas/OpenAIResponseText' + tools: type: array items: - $ref: '#/components/schemas/OpenAIResponseInput' - description: List of input items - object: - 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: - type: object - properties: - shield_id: - type: string - description: The identifier of the shield to run. - messages: + $ref: '#/components/schemas/OpenAIResponseInputTool' + include: type: array items: - $ref: '#/components/schemas/OpenAIMessageParam' - description: The messages to run the shield on. - params: + type: string + description: >- + (Optional) Additional fields to include in the response. + max_infer_iters: + type: integer + additionalProperties: false + 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 + 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 - 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' + OpenAIResponseInputMessageContentImage: 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 + 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) Message to convey to the user about the violation - metadata: + 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 - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + OpenAIResponseInputToolFileSearch: 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: - type: string - const: agent_turn_input - default: agent_turn_input + 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: >- - 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 + 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: >- - The type of scoring function parameters, always basic - aggregation_functions: - type: array - items: - $ref: '#/components/schemas/AggregationFunctionType' + 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: >- - 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 + 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: >- - Discriminator type. Always "chat_completion_input" - additionalProperties: false - required: - - type - title: ChatCompletionInputType - description: >- - Parameter type for chat completion input. - CompletionInputType: - type: object - properties: - type: - type: string - const: completion_input - default: completion_input + 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: >- - Discriminator type. Always "completion_input" - additionalProperties: false - required: - - type - title: CompletionInputType - description: Parameter type for completion input. - JsonType: - 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: - type: object - properties: - type: - $ref: '#/components/schemas/ScoringFnParamsType' - const: llm_as_judge - default: llm_as_judge + 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: >- - The type of scoring function parameters, always llm_as_judge - judge_model: - 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: >- - Identifier of the LLM model to use as a judge for scoring - prompt_template: - type: string + 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: >- - (Optional) Custom prompt template for the judge model - judge_score_regexes: - type: array - items: - type: string + 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: >- - Regexes to extract the answer from generated response - aggregation_functions: - type: array - items: - $ref: '#/components/schemas/AggregationFunctionType' + 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: >- - 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 + 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: >- - The type of scoring function parameters, always regex_parser - parsing_regexes: - type: array - items: - 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: >- - Regex to extract the answer from generated response - aggregation_functions: - type: array - items: - $ref: '#/components/schemas/AggregationFunctionType' + 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: >- - 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 + 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: >- - The resource type, always scoring_function - description: - type: string - metadata: + 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 - 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 + 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: - scoring_fn_id: - type: string - description: >- - The ID of the scoring function to register. - description: + created_at: + title: Created At + type: integer + error: + anyOf: + - $ref: '#/$defs/OpenAIResponseError' + - type: 'null' + id: + title: 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: + model: + title: Model type: string - description: >- - The ID of the provider scoring function to use for the scoring function. - provider_id: + object: + const: response + default: response + title: 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 + 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: + 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/ScoringFnParams' - - type: 'null' + - $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: >- - 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' + (Optional) ID of the previous response in a conversation + prompt: + $ref: '#/components/schemas/OpenAIResponsePrompt' description: >- - A map of scoring function name to ScoringResult. - additionalProperties: false + (Optional) Reference to a prompt template and its variables. + 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 required: - - results - title: ScoreResponse - description: The response from scoring. - ScoringResult: + - created_at + - id + - model + - output + - status + title: OpenAIResponseObject 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: + 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: - dataset_id: + id: + title: 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: + object: + const: response + default: response + title: Object + type: string + deleted: + default: true + title: Deleted type: boolean - description: >- - Whether to save the results to a dataset. - additionalProperties: false required: - - dataset_id - - scoring_functions - - save_results_dataset - title: ScoreBatchRequest - ScoreBatchResponse: + - id + title: OpenAIDeleteResponseObject type: object - properties: - dataset_id: - type: string + ListOpenAIResponseInputItem: + $defs: + MCPListToolsTool: description: >- - (Optional) The identifier of the dataset that was scored - results: + 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 - additionalProperties: - $ref: '#/components/schemas/ScoringResult' + OpenAIResponseAnnotationCitation: 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: + 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 - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - 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) 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 + 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: >- - The identifier of the shield to register. - provider_shield_id: - type: string + 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 shield in the provider. - provider_id: - type: string - description: The identifier of the provider. - params: + 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: The parameters of the shield. - additionalProperties: false - required: - - shield_id - title: RegisterShieldRequest - CompletionMessage: - type: object - properties: - role: - type: string - const: assistant - default: assistant + OpenAIResponseInputMessageContentImage: 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 + 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: >- - 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' + 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: >- - 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 + 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: >- - Discriminator type of the content item. Always "image" - image: + 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: - 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: + text: + title: Text type: string - contentEncoding: base64 - description: base64 encoded image data as string - additionalProperties: false + 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: >- - 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' - Message: - oneOf: - - $ref: '#/components/schemas/UserMessage' - - $ref: '#/components/schemas/SystemMessage' - - $ref: '#/components/schemas/ToolResponseMessage' - - $ref: '#/components/schemas/CompletionMessage' - discriminator: - propertyName: role - mapping: - user: '#/components/schemas/UserMessage' - system: '#/components/schemas/SystemMessage' - tool: '#/components/schemas/ToolResponseMessage' - assistant: '#/components/schemas/CompletionMessage' - SystemMessage: - type: object - properties: - role: - type: string - const: system - default: system + 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: >- - Must be "system" to identify this as a system message - content: - $ref: '#/components/schemas/InterleavedContent' + 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 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. - TextContentItem: - type: object - properties: - type: - type: string - const: text - default: text + 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: >- - 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 - ToolResponseMessage: - type: object - properties: - role: - type: string - const: tool - default: tool + 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: >- - Must be "tool" to identify this as a tool response - call_id: - type: string + 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: >- - 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 + 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: >- - A message representing the result of a tool invocation. - URL: - type: object + List container for OpenAI response input items. + + + :param data: List of input items + + :param object: Object type identifier, always "list" properties: - uri: + 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 type: string - description: The URL string pointing to the resource - additionalProperties: false required: - - uri - title: URL - description: A URL reference to external content. - UserMessage: + - data + title: ListOpenAIResponseInputItem 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' + RunShieldRequest: + type: object + RunShieldResponse: + $defs: + SafetyViolation: description: >- - The content of the message, which can include text and other media - context: - $ref: '#/components/schemas/InterleavedContent' + 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: >- - (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 + 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: >- - A message from the user in a chat conversation. - SyntheticDataGenerateRequest: - type: object + Response from running a safety shield. + + + :param violation: (Optional) Safety violation detected by the shield, if any properties: - dialogs: - type: array - items: - $ref: '#/components/schemas/Message' + violation: + anyOf: + - $ref: '#/$defs/SafetyViolation' + - type: 'null' + title: RunShieldResponse + type: object + ListScoringFunctionsResponse: + $defs: + AgentTurnInputType: description: >- - List of conversation messages to use as input for synthetic data generation - filtering_function: - type: string - enum: - - none - - random - - top_k - - top_p - - top_k_top_p - - sigmoid + 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: >- - Type of filtering to apply to generated synthetic data samples - model: + 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) The identifier of the model to use. The model must be registered - with Llama Stack and available via the /models endpoint - additionalProperties: false - required: - - dialogs - - filtering_function - title: SyntheticDataGenerateRequest - SyntheticDataGenerationResponse: - type: object - properties: - synthetic_data: - type: array - items: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - List of generated synthetic data samples that passed the filtering criteria - statistics: + 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 - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + BasicScoringFnParams: description: >- - (Optional) Statistical information about the generation process and filtering - results - additionalProperties: false - required: - - synthetic_data - title: SyntheticDataGenerationResponse - description: >- - Response from the synthetic data generation. Batch of (prompt, response, score) - tuples that pass the threshold. - InvokeToolRequest: - type: object - properties: - tool_name: - type: string - description: The name of the tool to invoke. - kwargs: + 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 - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + BooleanType: description: >- - A dictionary of arguments to pass to the tool. - additionalProperties: false - required: - - tool_name - - kwargs - title: InvokeToolRequest - ToolInvocationResult: - type: object - properties: - content: - $ref: '#/components/schemas/InterleavedContent' + 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: >- - (Optional) The output content from the tool execution - error_message: - 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: >- - (Optional) Error message if the tool execution failed - error_code: - type: integer + 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: >- - (Optional) Numeric error code if the tool execution failed - metadata: + 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 - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + LLMAsJudgeScoringFnParams: description: >- - (Optional) Additional metadata about the tool execution - additionalProperties: false - title: ToolInvocationResult - description: Result of a tool invocation. - ToolDef: - type: object - properties: - toolgroup_id: - type: string + 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: >- - (Optional) ID of the tool group this tool belongs to - name: - type: string - description: Name of the tool - description: - type: string + 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: >- - (Optional) Human-readable description of what the tool does - input_schema: + 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 - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - 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: >- - (Optional) JSON Schema for tool inputs (MCP inputSchema) - output_schema: + 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 - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + StringType: description: >- - (Optional) JSON Schema for tool outputs (MCP outputSchema) - metadata: + 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 - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + UnionType: description: >- - (Optional) Additional metadata about the tool - additionalProperties: false - required: - - name - title: ToolDef - description: >- - Tool definition used in runtime contexts. - ListToolDefsResponse: - 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: data: - type: array items: - $ref: '#/components/schemas/ToolDef' - description: List of tool definitions - additionalProperties: false + $ref: '#/$defs/ScoringFn' + title: Data + type: array 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: + title: ListScoringFunctionsResponse 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: + RegisterScoringFunctionRequest: type: object - properties: - type: - type: string - const: default - default: default - description: >- - Type of query generator, always 'default' - separator: - type: string - default: ' ' + ScoringFn: + $defs: + AgentTurnInputType: 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 + 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: >- - Name of the language model to use for query generation - 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: >- - 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} + Parameter type for array values. - Content: {chunk.content} - Metadata: {metadata} + :param type: Discriminator type. Always "array" + properties: + type: + const: array + default: array + title: Type + type: string + title: ArrayType + type: object + BasicScoringFnParams: 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 + 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: >- - Search mode for retrieval—either "vector", "keyword", or "hybrid". Default - "vector". - ranker: - $ref: '#/components/schemas/Ranker' + 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: >- - 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: - type: object - properties: - type: - type: string - const: rrf - default: rrf - description: The type of ranker, always "rrf" - impact_factor: - type: number - default: 60.0 + 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: >- - 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: - type: object - properties: - type: - type: string - const: weighted - default: weighted - description: The type of ranker, always "weighted" - alpha: - type: number - default: 0.5 + 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: >- - 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 - description: >- - Weighted ranker configuration that combines vector and keyword scores. - QueryRequest: - type: object - properties: - content: - $ref: '#/components/schemas/InterleavedContent' + 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 query content to search for in the indexed documents - vector_store_ids: - type: array - items: - type: string + 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: >- - List of vector database IDs to search within - query_config: - $ref: '#/components/schemas/RAGQueryConfig' + 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: >- - (Optional) Configuration parameters for the query operation - additionalProperties: false - required: - - content - - vector_store_ids - title: QueryRequest - RAGQueryResult: - type: object - properties: - content: - $ref: '#/components/schemas/InterleavedContent' + 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: >- - (Optional) The retrieved content from the query - metadata: + 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 - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + StringType: description: >- - Additional metadata about the query result - additionalProperties: false - required: - - metadata - title: RAGQueryResult + 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: >- - Result of a RAG query containing retrieved content and metadata. - ToolGroup: - type: object + 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: - type: string + 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 - 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: + anyOf: + - type: string + - type: 'null' + title: Description + metadata: + additionalProperties: true description: >- - (Optional) Model Context Protocol endpoint for remote tools - args: + Any additional metadata for this definition + title: Metadata type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + return_type: description: >- - (Optional) Additional arguments for the tool group - additionalProperties: false + 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 - - type - title: ToolGroup - description: >- - A group of related tools managed together. - ListToolGroupsResponse: + - return_type + title: ScoringFn 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: + ScoreRequest: type: object - properties: - toolgroup_id: - type: string - description: The ID of the tool group to register. - provider_id: - type: string - description: >- - The ID of the provider to use for the tool group. - mcp_endpoint: - $ref: '#/components/schemas/URL' + ScoreResponse: + $defs: + ScoringResult: description: >- - The MCP endpoint to use for the tool group. - args: + 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: - 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 + $ref: '#/$defs/ScoringResult' + title: Results + type: object required: - - toolgroup_id - - provider_id - title: RegisterToolGroupRequest - Chunk: + - results + title: ScoreResponse type: object - properties: - content: - $ref: '#/components/schemas/InterleavedContent' + ScoreBatchRequest: + type: object + ScoreBatchResponse: + $defs: + ScoringResult: description: >- - The content of the chunk, which can be interleaved text, images, or other - types. - metadata: + 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: + anyOf: + - type: string + - type: 'null' + title: Dataset Id + results: additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + $ref: '#/$defs/ScoringResult' + title: Results + type: object + required: + - results + title: ScoreBatchResponse + type: object + ListShieldsResponse: + $defs: + Shield: description: >- - Metadata associated with the chunk that will be used in the model context - during inference. - embedding: - type: array + 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: - type: number - description: >- - Optional embedding for the chunk. If not provided, it will be computed - later. - stored_chunk_id: - type: string - description: >- - The chunk ID that is stored in the vector database. Used for backend functionality. - 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 + $ref: '#/$defs/Shield' + title: Data + type: array required: - - content - - metadata - title: Chunk - description: >- - A chunk of content that can be inserted into a vector database. - ChunkMetadata: + - data + title: ListShieldsResponse type: object + RegisterShieldRequest: + type: object + 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: - 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 + identifier: description: >- - The ID of the document this chunk belongs to. - source: + Unique identifier for this resource in llama stack + title: Identifier type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' 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 + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: description: >- - The window of the chunk, which can be used to group related chunks together. - chunk_tokenizer: + ID of the provider that owns this resource + title: Provider Id type: string - description: >- - The tokenizer used to create the chunk. Default is Tiktoken. - chunk_embedding_model: + 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: >- - The embedding model used to create the chunk's embedding. - chunk_embedding_dimension: - type: integer + 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: >- - The dimension of the embedding vector for the chunk. - content_token_count: - type: integer + 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: >- - The number of tokens in the content of the chunk. - metadata_token_count: - type: integer + 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: >- - 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: + 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 + 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: - vector_store_id: + uri: + title: Uri 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: + - uri + title: URL type: object - properties: - vector_store_id: - type: string + ListToolDefsResponse: + $defs: + ToolDef: description: >- - The identifier of the vector database to query. - query: - $ref: '#/components/schemas/InterleavedContent' - description: The query to search for. - params: + 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 - 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 + description: >- + Response containing a list of tool definitions. + + + :param data: List of tool definitions properties: - chunks: - type: array + data: items: - $ref: '#/components/schemas/Chunk' - description: >- - List of content chunks returned from the query - scores: + $ref: '#/$defs/ToolDef' + title: Data type: array - items: - type: number - description: >- - Relevance scores corresponding to each returned chunk - additionalProperties: false required: - - chunks - - scores - title: QueryChunksResponse - description: >- - Response from querying chunks in a vector database. - VectorStoreFileCounts: + - data + title: ListToolDefsResponse type: object - properties: - completed: - type: integer + InsertRequest: + type: object + QueryRequest: + type: object + RAGQueryResult: + $defs: + ImageContentItem: description: >- - Number of files that have been successfully processed - cancelled: - type: integer + 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: >- - Number of files that had their processing cancelled - failed: - type: integer - description: Number of files that failed to process - in_progress: - type: integer + 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: >- - Number of files currently being processed - total: - type: integer + 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: >- - 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: + 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: + 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 + 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: >- + Response containing a list of tool groups. + + + :param data: List of tool groups 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 + $ref: '#/$defs/ToolGroup' + title: Data + type: array required: - - object - data - - has_more - title: VectorStoreListResponse - description: Response from listing vector stores. - VectorStoreObject: + title: ListToolGroupsResponse type: object - properties: - id: - type: string - description: Unique identifier for the vector store - object: - type: string - default: vector_store + RegisterToolGroupRequest: + type: object + ToolGroup: + $defs: + URL: description: >- - Object type identifier, always "vector_store" - created_at: - type: integer + 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: description: >- - Timestamp when the vector store was created - name: + Unique identifier for this resource in llama stack + title: Identifier type: string - description: (Optional) Name of the vector store - usage_bytes: - type: integer - default: 0 + provider_resource_id: + anyOf: + - type: string + - type: 'null' description: >- - Storage space used by the vector store in bytes - file_counts: - $ref: '#/components/schemas/VectorStoreFileCounts' + Unique identifier for this resource in the provider + title: Provider Resource Id + provider_id: description: >- - File processing status counts for the vector store - status: + ID of the provider that owns this resource + title: Provider Id 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 + 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: - - id - - object - - created_at - - usage_bytes - - file_counts - - status - - metadata - title: VectorStoreObject - description: OpenAI Vector Store object. - "OpenAICreateVectorStoreRequestWithExtraBody": + - identifier + - provider_id + title: ToolGroup 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 properties: + toolgroup_id: + anyOf: + - type: string + - type: 'null' + title: Toolgroup Id name: + title: Name type: string - description: (Optional) A name for the vector store - file_ids: - type: array - items: - 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 + InsertChunksRequest: + type: object + QueryChunksRequest: + type: object + QueryChunksResponse: + $defs: + Chunk: description: >- - List of file IDs to include in the vector store - expires_after: + 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: >- - (Optional) Expiration policy for the vector store - chunking_strategy: + 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 - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + ImageContentItem: description: >- - (Optional) Strategy for splitting files into chunks - metadata: + 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 - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + TextContentItem: 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: + 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 + URL: description: >- - The expiration policy for a vector store. - metadata: + 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 - 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 - properties: - 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 - 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 + _URLOrData: description: >- - Strategy type, always "auto" for automatic chunking - additionalProperties: false - required: - - type - title: VectorStoreChunkingStrategyAuto + 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: >- - Automatic chunking strategy for vector store files. - VectorStoreChunkingStrategyStatic: - type: object + 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: - 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 + chunks: + items: + $ref: '#/$defs/Chunk' + title: Chunks + type: array + scores: + items: + type: number + title: Scores + type: array required: - - type - - static - title: VectorStoreChunkingStrategyStatic - description: >- - Static chunking strategy with configurable parameters. - VectorStoreChunkingStrategyStaticConfig: + - chunks + - scores + title: QueryChunksResponse type: object - properties: - chunk_overlap_tokens: - type: integer - default: 400 + VectorStoreListResponse: + $defs: + VectorStoreFileCounts: description: >- - Number of tokens to overlap between adjacent chunks - max_chunk_size_tokens: - type: integer - default: 800 + 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: >- - Maximum number of tokens per chunk, must be between 100 and 4096 - additionalProperties: false - required: - - chunk_overlap_tokens - - max_chunk_size_tokens - title: VectorStoreChunkingStrategyStaticConfig + 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: >- - Configuration for static chunking strategy. - "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": - type: object + 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: - file_ids: - type: array + object: + default: list + title: Object + type: string + data: items: - type: string + $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: >- - A list of File IDs that the vector store should use - attributes: + 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 - 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: 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 - description: Unique identifier for the file batch object: + default: vector_store + title: Object type: string - default: vector_store.file_batch - description: >- - Object type identifier, always "vector_store.file_batch" created_at: + title: Created At + type: integer + name: + anyOf: + - type: string + - type: 'null' + title: Name + usage_bytes: + default: 0 + title: Usage Bytes type: integer - description: >- - Timestamp when the file batch was created - 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 file_counts: - $ref: '#/components/schemas/VectorStoreFileCounts' - description: >- - File processing status counts for the batch - additionalProperties: false + $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 - - 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: + title: VectorStoreObject type: object - properties: - code: - oneOf: - - type: string - const: server_error - - type: string - const: rate_limit_exceeded - description: >- - Error code indicating the type of failure - message: - 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: + OpenaiUpdateVectorStoreRequest: 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 - description: Unique identifier for the file object: + default: vector_store.deleted + title: Object type: string - default: vector_store.file - description: >- - Object type identifier, always "vector_store.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 - chunking_strategy: - oneOf: - - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' - - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' - discriminator: - propertyName: type - mapping: - auto: '#/components/schemas/VectorStoreChunkingStrategyAuto' - static: '#/components/schemas/VectorStoreChunkingStrategyStatic' + deleted: + default: true + title: Deleted + type: boolean + required: + - id + title: VectorStoreDeleteResponse + type: object + VectorStoreFileBatchObject: + $defs: + VectorStoreFileCounts: description: >- - Strategy used for splitting the file into chunks + 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 + object: + default: vector_store.file_batch + title: Object + type: string 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 - 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: + title: Vector Store Id type: string - description: >- - ID of the vector store containing this file - additionalProperties: false + 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' required: - id - - object - - attributes - - chunking_strategy - created_at - - status - - usage_bytes - vector_store_id - title: VectorStoreFileObject - description: OpenAI Vector Store File object. - VectorStoreFilesListInBatchResponse: + - status + - file_counts + title: VectorStoreFileBatchObject 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: object: - type: string default: list - description: Object type identifier, always "list" + title: Object + type: string data: - type: array items: - $ref: '#/components/schemas/VectorStoreFileObject' - description: >- - List of vector store file objects in the batch + $ref: '#/$defs/VectorStoreFileObject' + title: Data + type: array first_id: - type: string - description: >- - (Optional) ID of the first file in the list for pagination + anyOf: + - type: string + - type: 'null' + title: First Id last_id: - type: string - description: >- - (Optional) ID of the last file in the list for pagination + anyOf: + - type: string + - type: 'null' + title: Last Id has_more: - type: boolean default: false - description: >- - Whether there are more files available beyond this page - additionalProperties: false + title: Has More + type: boolean required: - - object - data - - has_more title: VectorStoreFilesListInBatchResponse - description: >- - Response from listing files in a vector store file batch. - VectorStoreListFilesResponse: type: object + Union: + type: object + nullable: true + VectorStoreListFilesResponse: + $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. + + + :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: - type: string default: list - description: Object type identifier, always "list" + title: Object + type: string data: - type: array items: - $ref: '#/components/schemas/VectorStoreFileObject' - description: List of vector store file objects + $ref: '#/$defs/VectorStoreFileObject' + title: Data + type: array first_id: - type: string - description: >- - (Optional) ID of the first file in the list for pagination + anyOf: + - type: string + - type: 'null' + title: First Id last_id: - type: string - description: >- - (Optional) ID of the last file in the list for pagination + anyOf: + - type: string + - type: 'null' + title: Last Id has_more: - type: boolean default: false - description: >- - Whether there are more files available beyond this page - additionalProperties: false + title: Has More + type: boolean required: - - object - data - - has_more title: VectorStoreListFilesResponse - description: >- - Response from listing files in a vector store. + 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: >- + 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: >- + 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: - file_id: + id: + title: Id + type: string + object: + default: vector_store.file + title: Object type: string - description: >- - The ID of the file to attach to the vector store. attributes: + additionalProperties: true + title: 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 + 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: - - file_id - title: OpenaiAttachFileToVectorStoreRequest + - id + - chunking_strategy + - created_at + - status + - vector_store_id + title: VectorStoreFileObject + type: object 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 + VectorStoreFileContentsResponse: + $defs: + VectorStoreContent: description: >- - Content type, currently only "text" is supported - text: - type: string - description: The actual text content - additionalProperties: false - required: - - type - - text - title: VectorStoreContent + 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 description: >- - Content item from a vector store file or search result. - VectorStoreFileContentsResponse: - type: object + 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 for the file filename: + title: Filename type: string - description: Name of the file 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 content: - type: array items: - $ref: '#/components/schemas/VectorStoreContent' - description: List of content items from the file - additionalProperties: false + $ref: '#/$defs/VectorStoreContent' + title: Content + type: array required: - file_id - filename - attributes - content title: VectorStoreFileContentsResponse - description: >- - Response from retrieving the contents of a vector store file. + type: object OpenaiSearchVectorStoreRequest: type: object - properties: - query: - oneOf: - - type: string - - type: array - items: - type: string + VectorStoreSearchResponsePage: + $defs: + VectorStoreContent: description: >- - The query string or array for performing the search. - filters: + 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 - 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 + VectorStoreSearchResponse: description: >- - Maximum number of results to return (1 to 50 inclusive, default 10). - ranking_options: - type: object + 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: - ranker: + file_id: + title: File Id type: string - description: >- - (Optional) Name of the ranking algorithm to use - score_threshold: + filename: + title: Filename + type: string + score: + title: Score 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 - properties: - 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 - attributes: + 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 - 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 - required: - - file_id - - filename - - score - - content - title: VectorStoreSearchResponse - description: Response from searching a vector store. - VectorStoreSearchResponsePage: - 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. - 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: + - version + title: VersionInfo + type: object + AppendRowsRequest: 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: - 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 - properties: - purpose: - type: string + 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: >- - 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: + 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 - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + URIDataSource: description: >- - The metadata for the dataset. - E.g. {"description": "My dataset"}. - dataset_id: + 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: + identifier: + description: >- + 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 dataset. If not provided, an ID will be generated. - additionalProperties: false + 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: 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 + required: + - agent_id + title: AgentCreateResponse + type: object + Agent: + $defs: + AgentConfig: 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 + 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 + type: object + GrammarResponseFormat: description: >- - Must be "grammar" to identify this format type - const: grammar - default: grammar - bnf: + 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 + GreedySamplingStrategy: 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 + 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: >- - 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: + 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 - - grammar - description: >- - Must be "json_schema" to identify this format type - const: json_schema - default: json_schema - json_schema: + title: JsonSchemaResponseFormat 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 + SamplingParams: 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 + 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 - properties: - session_name: - type: string - description: The name of the session to create. - additionalProperties: false - required: - - session_name - title: CreateAgentSessionRequest AgentSessionCreateResponse: - type: object + description: >- + Response returned when creating a new agent session. + + + :param session_id: Unique identifier for the created session properties: session_id: + title: 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. - 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 + 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: - - 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: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool 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: + 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: - - 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: + - info + - warn + - error + title: ViolationLevel type: string + _URLOrData: 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 + 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: - 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. - ToolExecutionStep: + CreateAgentTurnRequest: 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: + 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 - format: date-time - description: The time the step completed. - step_type: + 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: - - 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: + - info + - warn + - error + title: ViolationLevel type: string + _URLOrData: 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: + 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 - 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. - Turn: - 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 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 @@ -12172,1309 +17563,1056 @@ components: - output_message - started_at title: Turn - description: >- - A single turn in an interaction with an Agentic System. - 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: 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 - 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 - 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: + ResumeAgentTurnRequest: 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 + 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 - 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 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: >- - 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 + 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: >- - Unique identifier for the step within a turn - metadata: + 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 - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object + MemoryRetrievalStep: 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' + 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: >- - 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 + 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: - - 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: + - end_of_turn + - end_of_message + - out_of_tokens + title: StopReason type: string + TextContentItem: 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 + 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: >- - 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 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: >- - 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: - type: string - const: tool_call - default: tool_call + 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 "tool_call" - tool_call: - oneOf: - - type: string - - $ref: '#/components/schemas/ToolCall' + 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: >- - Either an in-progress tool call string or the final parsed tool call - parse_status: - type: string + 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: - - 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' + - info + - warn + - error + title: ViolationLevel + type: string + _URLOrData: 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 + 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 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 - 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 + $defs: + Benchmark: 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: - type: object + 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: - type: - type: string - const: agent - default: agent - config: - $ref: '#/components/schemas/AgentConfig' - description: >- - The configuration for the agent candidate. - additionalProperties: false + data: + items: + $ref: '#/$defs/Benchmark' + title: Data + type: array required: - - type - - config - title: AgentCandidate - description: An agent candidate for evaluation. - BenchmarkConfig: + - 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: - 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' + identifier: description: >- - Map between scoring function id and parameters for each scoring function - you want to run - num_examples: - type: integer + Unique identifier for this resource in llama stack + title: Identifier + type: string + provider_resource_id: + anyOf: + - type: string + - type: 'null' 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 - properties: + 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 - const: model - default: model - model: + dataset_id: + title: Dataset Id 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. - 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 + title: Scoring Functions + type: array + metadata: + additionalProperties: true + description: Metadata for this evaluation task + title: Metadata + type: object required: - - input_rows + - identifier + - provider_id + - dataset_id - scoring_functions - - benchmark_config - title: EvaluateRowsRequest - EvaluateResponse: + title: Benchmark + type: object + 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: 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 + 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: >- - 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 + 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 @@ -13551,16 +18689,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/fastapi_generator.py b/docs/openapi_generator/fastapi_generator.py new file mode 100755 index 0000000000..f2b869fdd6 --- /dev/null +++ b/docs/openapi_generator/fastapi_generator.py @@ -0,0 +1,1006 @@ +#!/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. +This replaces the complex pyopenapi implementation with a simple, clean approach. +""" + +import json +import yaml +from pathlib import Path +from typing import Any, Dict, List, Optional, get_args, get_origin +from fastapi import FastAPI, HTTPException, Query, Path as FastAPIPath, Body +from fastapi.openapi.utils import get_openapi +from pydantic import BaseModel, Field +from typing import Annotated +import inspect + +# Import the existing route discovery system +from llama_stack.core.server.routes import get_all_api_routes +from llama_stack.core.resolver import api_protocol_map +from llama_stack.apis.datatypes import Api +from llama_stack.apis.version import LLAMA_STACK_API_V1 +from llama_stack.schema_utils import ExtraBodyField, json_schema_type + +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 api_name, 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 = _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: + 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: + 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]: + """ + 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. + """ + 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 + for param_name, param in sig.parameters.items(): + if param_name == "self": + continue + + # Check if it's a Pydantic model + 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 + + # 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 + + except Exception: + # If we can't analyze the function signature, return None + return None, None + +def _extract_extra_body_params(func) -> List[Dict[str, Any]]: + """ + Extract ExtraBodyField parameters from a function signature. + These will be added as x-llama-stack-extra-body-params in the OpenAPI spec. + """ + extra_body_params = [] + + try: + sig = inspect.signature(func) + for param_name, param in sig.parameters.items(): + if param_name == "self": + continue + + param_type = param.annotation + + # Check if it's an Annotated type with ExtraBodyField + if get_origin(param_type) is Annotated: + args = get_args(param_type) + base_type = args[0] + metadata = args[1:] + + # Look for ExtraBodyField in metadata + extra_body_field = None + for item in metadata: + if isinstance(item, ExtraBodyField): + extra_body_field = item + break + + if extra_body_field: + # Generate schema for the base type + schema = _generate_schema_for_type(base_type) + + extra_body_params.append({ + "name": param_name, + "schema": schema, + "description": extra_body_field.description or f"Extra body parameter: {param_name}", + "required": param.default is inspect.Parameter.empty + }) + except Exception as e: + # If we can't process the function signature, just continue + pass + + return extra_body_params + +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: + 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_impl = 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"] = {} + 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 status_code, 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 _control_schema_registration(openapi_schema: Dict[str, Any]) -> Dict[str, Any]: + """ + Control which schemas are registered as top-level components vs inlined. + Only schemas marked with @json_schema_type decorator become top-level components. + """ + if "components" not in openapi_schema or "schemas" not in openapi_schema["components"]: + return openapi_schema + + schemas = openapi_schema["components"]["schemas"] + schemas_to_keep = {} + schemas_to_inline = {} + + # Separate schemas based on @json_schema_type decorator + for schema_name, schema_def in schemas.items(): + # Try to find the original class to check for the decorator + if _should_keep_as_component(schema_name, schema_def): + schemas_to_keep[schema_name] = schema_def + else: + schemas_to_inline[schema_name] = schema_def + + # Add registered schemas (like union types) that might not be in the original schemas + _add_registered_schemas(schemas_to_keep) + + # Update the schemas to only keep marked ones + openapi_schema["components"]["schemas"] = schemas_to_keep + + # Inline the unmarked schemas throughout the spec + openapi_schema = _inline_schemas(openapi_schema, schemas_to_inline) + + return openapi_schema + +def _add_registered_schemas(schemas_to_keep: Dict[str, Any]) -> None: + """ + Add schemas that were registered with register_schema() to the schemas to keep. + This handles union types and other complex types that should be top-level components. + """ + try: + # Import the registered schemas registry + from llama_stack.schema_utils import _registered_schemas + + # Process all registered schemas + for schema_type, registration_info in _registered_schemas.items(): + schema_name = registration_info['name'] + if schema_name not in schemas_to_keep: + # Generate the schema for the union type + union_schema = _generate_union_schema(schema_type) + if union_schema: + schemas_to_keep[schema_name] = union_schema + except ImportError: + # If we can't import the schema utils, skip + pass + +def _generate_union_schema(union_type) -> Dict[str, Any] | None: + """ + Generate an OpenAPI schema for a union type. + """ + try: + # Get the union args + from typing import get_args, get_origin + + if get_origin(union_type) is type(union_type): # Check if it's a union type + args = get_args(union_type) + if len(args) == 2: + # Handle str | SomeModel case + str_schema = {"type": "string"} + + # Find the model schema + model_schema = None + for arg in args: + if hasattr(arg, '__name__') and arg.__name__ != 'str': + # This is likely a Pydantic model + model_schema = { + "type": "object", + "properties": {}, + "required": [], + "title": arg.__name__ + } + + # Add properties from the model + if hasattr(arg, 'model_fields'): + for field_name, field_info in arg.model_fields.items(): + field_type = field_info.annotation + if field_type == str: + model_schema["properties"][field_name] = {"type": "string"} + elif field_type == dict: + model_schema["properties"][field_name] = { + "type": "object", + "additionalProperties": True + } + else: + model_schema["properties"][field_name] = {"type": "object"} + + if field_info.is_required(): + model_schema["required"].append(field_name) + + break + + if model_schema: + return { + "oneOf": [str_schema, model_schema] + } + except Exception: + # If we can't generate the schema, return None + pass + + return None + +def _should_keep_as_component(schema_name: str, schema_def: Dict[str, Any]) -> bool: + """ + Determine if a schema should be kept as a top-level component. + This checks for the @json_schema_type decorator marker. + """ + # Try to find the actual class that generated this schema + model_class = _find_model_class_by_name(schema_name) + + if model_class: + # Check if the class has the @json_schema_type decorator + return hasattr(model_class, '_llama_stack_schema_type') + + # Fallback to heuristics if we can't find the class + # Check if it's a simple type that should be inlined + if schema_def.get("type") == "object" and len(schema_def.get("properties", {})) <= 3: + # Simple objects with few properties are good candidates for inlining + return False + + # Check for common patterns that should be components + if any(keyword in schema_name.lower() for keyword in ["request", "response", "error", "base"]): + return True + + # Default to keeping as component + return True + +def _find_model_class_by_name(schema_name: str): + """ + Try to find the actual Pydantic model class by name. + This searches through the API modules to find the class. + """ + try: + # Import common API modules where models are defined + from llama_stack.apis import agents, conversations, inference, vector_io, datasetio + from llama_stack.apis.agents import openai_responses + from llama_stack.apis.inference import inference as inference_api + + # List of modules to search + modules_to_search = [ + agents, conversations, inference, vector_io, datasetio, + openai_responses, inference_api + ] + + # Try exact name first + for module in modules_to_search: + if hasattr(module, schema_name): + cls = getattr(module, schema_name) + if hasattr(cls, 'model_json_schema'): # It's a Pydantic model + return cls + + # Try removing common suffixes like -Input, -Output + base_name = schema_name + for suffix in ['-Input', '-Output', '-Request', '-Response']: + if schema_name.endswith(suffix): + base_name = schema_name[:-len(suffix)] + break + + for module in modules_to_search: + if hasattr(module, base_name): + cls = getattr(module, base_name) + if hasattr(cls, 'model_json_schema'): # It's a Pydantic model + return cls + + return None + except Exception: + return None + +def _inline_schemas(openapi_schema: Dict[str, Any], schemas_to_inline: Dict[str, Any]) -> Dict[str, Any]: + """ + Inline the specified schemas throughout the OpenAPI spec. + This replaces $ref references with the actual schema definitions. + """ + # This is a simplified implementation + # In practice, you'd need to recursively traverse the entire spec + # and replace $ref references with the actual schema definitions + + # For now, we'll just remove the schemas from components + # A full implementation would need to: + # 1. Find all $ref references to these schemas + # 2. Replace them with the actual schema definitions + # 3. Handle circular references appropriately + + return openapi_schema + +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 + # This is a simplified approach - a full implementation would recursively find all referenced schemas + if "components" in filtered_schema and "schemas" in filtered_schema["components"]: + # For now, keep all schemas (they might be shared between versions) + # In a full implementation, we'd filter based on actual usage + pass + + return filtered_schema + +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) + + # Control schema registration based on @json_schema_type decorator + openapi_schema = _control_schema_registration(openapi_schema) + + # Split into stable (v1 only), experimental (v1alpha + v1beta), and deprecated specs + stable_schema = _filter_schema_by_version(openapi_schema, stable_only=True, exclude_deprecated=True) + experimental_schema = _filter_schema_by_version(openapi_schema, stable_only=False, exclude_deprecated=True) + deprecated_schema = _filter_deprecated_schema(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) + + # 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/docs/openapi_generator/generate.py b/docs/openapi_generator/generate.py deleted file mode 100644 index b489833b38..0000000000 --- a/docs/openapi_generator/generate.py +++ /dev/null @@ -1,140 +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" - html_filename = f"{filename_prefix}llama-stack-spec.html" - - 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, - ) - - with open(output_dir / html_filename, "w") as fp: - spec.write_html(fp, pretty_print=True) - - print(f"Generated {yaml_filename} and {html_filename}") - -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.html b/docs/static/deprecated-llama-stack-spec.html index dca1296317..a27640e847 100644 --- a/docs/static/deprecated-llama-stack-spec.html +++ b/docs/static/deprecated-llama-stack-spec.html @@ -1,13582 +1,16 @@ - - + Llama Stack API Documentation + - OpenAPI specification - - - - - - + + - diff --git a/docs/static/deprecated-llama-stack-spec.yaml b/docs/static/deprecated-llama-stack-spec.yaml index 12d1327a2a..44206d515b 100644 --- a/docs/static/deprecated-llama-stack-spec.yaml +++ b/docs/static/deprecated-llama-stack-spec.yaml @@ -1,21 +1,21 @@ 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 +- 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 Agents + description: Response-only endpoint for proper schema generation. + operationId: list_agents_v1_agents_get responses: '200': description: A PaginatedResponse. @@ -24,127 +24,120 @@ paths: schema: $ref: '#/components/schemas/PaginatedResponse' '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: 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: true post: + tags: + - V1 + summary: Create Agent + description: Typed endpoint for proper schema generation. + operationId: create_agent_v1_agents_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AgentConfig-Input' + required: true 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': + 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: >- - 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' - required: true deprecated: true /v1/agents/{agent_id}: - get: + delete: + tags: + - V1 + summary: Delete Agent + 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 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. - parameters: - - name: agent_id - in: path - description: ID of the agent. - required: true - schema: - type: string + - V1 + summary: Get Agent + description: Response-only endpoint for proper schema generation. + operationId: get_agent_v1_agents__agent_id__get deprecated: true - delete: 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: true + description: Default Response /v1/agents/{agent_id}/session: post: + tags: + - V1 + summary: Create Agent Session + description: Response-only endpoint for proper schema generation. + operationId: create_agent_session_v1_agents__agent_id__session_post responses: '200': description: An AgentSessionCreateResponse. @@ -153,168 +146,115 @@ paths: schema: $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' + deprecated: true + /v1/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. + - V1 + summary: Delete Agents Session + 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: 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: true - /v1/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. - 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 + - V1 + summary: Get Agents Session + description: Response-only endpoint for proper schema generation. + operationId: get_agents_session_v1_agents__agent_id__session__session_id__get deprecated: true - delete: 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: true + description: Default Response /v1/agents/{agent_id}/session/{session_id}/turn: post: + tags: + - V1 + summary: Create Agent Turn + description: Response-only endpoint for proper schema generation. + operationId: create_agent_turn_v1_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': + 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: Create a new turn for an agent. - description: Create a new turn for an agent. - 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' - required: true deprecated: true /v1/agents/{agent_id}/session/{session_id}/turn/{turn_id}: get: + tags: + - V1 + summary: Get Agents Turn + description: Response-only endpoint for proper schema generation. + operationId: get_agents_turn_v1_agents__agent_id__session__session_id__turn__turn_id__get responses: '200': description: A Turn. @@ -323,102 +263,53 @@ paths: 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' - 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: true /v1/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume: post: + tags: + - V1 + summary: Resume Agent Turn + description: Response-only endpoint for proper schema generation. + operationId: resume_agent_turn_v1_agents__agent_id__session__session_id__turn__turn_id__resume_post 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': + 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: >- - 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. - 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' - required: true deprecated: true /v1/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}: get: + tags: + - V1 + summary: Get Agents Step + description: Response-only endpoint for proper schema generation. + operationId: get_agents_step_v1_agents__agent_id__session__session_id__turn__turn_id__step__step_id__get responses: '200': description: An AgentStepResponse. @@ -427,48 +318,25 @@ paths: schema: $ref: '#/components/schemas/AgentStepResponse' '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 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: true /v1/agents/{agent_id}/sessions: get: + tags: + - V1 + summary: List Agent Sessions + description: Response-only endpoint for proper schema generation. + operationId: list_agent_sessions_v1_agents__agent_id__sessions_get responses: '200': description: A PaginatedResponse. @@ -477,76 +345,62 @@ paths: schema: $ref: '#/components/schemas/PaginatedResponse' '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: 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: true /v1/datasetio/append-rows/{dataset_id}: post: + tags: + - V1 + summary: Append Rows + 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 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: - - DatasetIO - summary: Append rows to a dataset. - description: Append rows to a dataset. - 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' - required: true - deprecated: true + description: Default Response /v1/datasetio/iterrows/{dataset_id}: get: + tags: + - V1 + summary: Iterrows + description: Response-only endpoint for proper schema generation. + operationId: iterrows_v1_datasetio_iterrows__dataset_id__get responses: '200': description: A PaginatedResponse. @@ -555,58 +409,25 @@ paths: schema: $ref: '#/components/schemas/PaginatedResponse' '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: - - 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: true /v1/datasets: get: + tags: + - V1 + summary: List Datasets + description: Response-only endpoint for proper schema generation. + operationId: list_datasets_v1_datasets_get responses: '200': description: A ListDatasetsResponse. @@ -615,22 +436,24 @@ 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. - parameters: [] deprecated: true post: + tags: + - V1 + summary: Register Dataset + description: Response-only endpoint for proper schema generation. + operationId: register_dataset_v1_datasets_post responses: '200': description: A Dataset. @@ -639,86 +462,89 @@ 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' - tags: - - Datasets - summary: Register a new dataset. - description: Register a new dataset. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterDatasetRequest' - required: true deprecated: true /v1/datasets/{dataset_id}: - get: + delete: + tags: + - V1 + summary: Unregister Dataset + 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 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. - parameters: - - name: dataset_id - in: path - description: The ID of the dataset to get. - required: true - schema: - type: string + - V1 + summary: Get Dataset + description: Response-only endpoint for proper schema generation. + operationId: get_dataset_v1_datasets__dataset_id__get deprecated: true - delete: 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: true + description: Default Response /v1/eval/benchmarks: get: + tags: + - V1 + summary: List Benchmarks + description: Response-only endpoint for proper schema generation. + operationId: list_benchmarks_v1_eval_benchmarks_get + deprecated: true responses: '200': description: A ListBenchmarksResponse. @@ -728,183 +554,225 @@ 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. - parameters: [] + - V1 + summary: Register Benchmark + description: Generic endpoint - this would be replaced with actual implementation. + operationId: register_benchmark_v1_eval_benchmarks_post deprecated: true - 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/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' - required: true + - V1 + summary: Unregister Benchmark + description: Generic endpoint - this would be replaced with actual implementation. + operationId: unregister_benchmark_v1_eval_benchmarks__benchmark_id__delete deprecated: true - /v1/eval/benchmarks/{benchmark_id}: - get: + parameters: + - name: args + in: query + required: true + 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. - parameters: - - name: benchmark_id - in: path - description: The ID of the benchmark to get. - required: true - schema: - type: string + - V1 + summary: Get Benchmark + description: Response-only endpoint for proper schema generation. + operationId: get_benchmark_v1_eval_benchmarks__benchmark_id__get deprecated: true - delete: 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: true + description: Default Response /v1/eval/benchmarks/{benchmark_id}/evaluations: post: - responses: - '200': - description: >- - EvaluateResponse object containing generations and scores. - content: + tags: + - V1 + summary: Evaluate Rows + 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': - $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' + deprecated: true + /v1/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 + - V1 + summary: Run Eval + 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/EvaluateRowsRequest' + $ref: '#/components/schemas/BenchmarkConfig' required: true - deprecated: true - /v1/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' + deprecated: true + /v1/eval/benchmarks/{benchmark_id}/jobs/{job_id}: + delete: tags: - - Eval - summary: Run an evaluation on a benchmark. - description: Run an evaluation on a benchmark. + - V1 + summary: Job Cancel + 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: 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: true - /v1/eval/benchmarks/{benchmark_id}/jobs/{job_id}: + 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: Job Status + description: Response-only endpoint for proper schema generation. + operationId: job_status_v1_eval_benchmarks__benchmark_id__jobs__job_id__get + deprecated: true responses: '200': description: The status of the evaluation job. @@ -914,195 +782,216 @@ paths: $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' + description: Default Response + /v1/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result: + get: tags: - - Eval - summary: Get the status of a job. - description: Get the status 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 status of. - required: true - schema: - type: string - deprecated: true - delete: + - V1 + summary: Job Result + description: Response-only endpoint for proper schema generation. + operationId: job_result_v1_eval_benchmarks__benchmark_id__jobs__job_id__result_get responses: '200': - description: OK + description: The result of the job. + 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: 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: true - /v1/eval/benchmarks/{benchmark_id}/jobs/{job_id}/result: + /v1/openai/v1/batches: get: + tags: + - V1 + summary: List Batches + description: Response-only endpoint for proper schema generation. + operationId: list_batches_v1_openai_v1_batches_get responses: '200': - description: The result of the job. + description: A list of batch objects. content: application/json: schema: - $ref: '#/components/schemas/EvaluateResponse' + $ref: '#/components/schemas/ListBatchesResponse' '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' + deprecated: true + post: 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 + - V1 + summary: Create Batch + description: Response-only endpoint for proper schema generation. + operationId: create_batch_v1_openai_v1_batches_post + responses: + '200': + description: The created 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 - /v1/openai/v1/chat/completions: + /v1/openai/v1/batches/{batch_id}: get: + tags: + - V1 + summary: Retrieve Batch + description: Response-only endpoint for proper schema generation. + operationId: retrieve_batch_v1_openai_v1_batches__batch_id__get responses: '200': - description: A ListOpenAIChatCompletionResponse. + description: The batch object. content: application/json: schema: - $ref: '#/components/schemas/ListOpenAIChatCompletionResponse' + $ref: '#/components/schemas/Batch' '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: 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: true + /v1/openai/v1/batches/{batch_id}/cancel: post: + tags: + - V1 + summary: Cancel Batch + description: Response-only endpoint for proper schema generation. + operationId: cancel_batch_v1_openai_v1_batches__batch_id__cancel_post responses: '200': - description: An OpenAIChatCompletion. + 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 + /v1/openai/v1/chat/completions: + get: + tags: + - V1 + summary: List Chat Completions + description: Response-only endpoint for proper schema generation. + operationId: list_chat_completions_v1_openai_v1_chat_completions_get + responses: + '200': + description: A ListOpenAIChatCompletionResponse. content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/OpenAIChatCompletion' - - $ref: '#/components/schemas/OpenAIChatCompletionChunk' + $ref: '#/components/schemas/ListOpenAIChatCompletionResponse' '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' + deprecated: true + post: 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: [] + - V1 + summary: Openai Chat Completion + description: Typed endpoint for proper schema generation. + operationId: openai_chat_completion_v1_openai_v1_chat_completions_post requestBody: content: application/json: schema: $ref: '#/components/schemas/OpenAIChatCompletionRequestWithExtraBody' required: true + responses: + '200': + description: An OpenAIChatCompletion. + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAIChatCompletion' + '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/chat/completions/{completion_id}: get: + tags: + - V1 + summary: Get Chat Completion + description: Response-only endpoint for proper schema generation. + operationId: get_chat_completion_v1_openai_v1_chat_completions__completion_id__get responses: '200': description: A OpenAICompletionWithInputMessages. @@ -1111,32 +1000,31 @@ paths: schema: $ref: '#/components/schemas/OpenAICompletionWithInputMessages' '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: 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: true /v1/openai/v1/completions: post: + tags: + - V1 + summary: Openai 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. @@ -1145,289 +1033,201 @@ 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' + deprecated: true + /v1/openai/v1/embeddings: + 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: Openai Embeddings + description: Typed endpoint for proper schema generation. + operationId: openai_embeddings_v1_openai_v1_embeddings_post requestBody: content: application/json: schema: - $ref: '#/components/schemas/OpenAICompletionRequestWithExtraBody' + $ref: '#/components/schemas/OpenAIEmbeddingsRequestWithExtraBody' required: true - deprecated: true - /v1/openai/v1/embeddings: - post: responses: '200': - description: >- - An OpenAIEmbeddingsResponse containing the embeddings. + description: An OpenAIEmbeddingsResponse containing the embeddings. content: application/json: schema: $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' - tags: - - Inference - summary: Create embeddings. - description: >- - Create embeddings. - - Generate OpenAI-compatible embeddings for the given input using the specified - model. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAIEmbeddingsRequestWithExtraBody' - required: true deprecated: true /v1/openai/v1/files: get: + tags: + - V1 + summary: Openai List Files + description: Response-only endpoint for proper schema generation. + operationId: openai_list_files_v1_openai_v1_files_get responses: '200': - description: >- - An ListOpenAIFileResponse containing the list of files. + description: An ListOpenAIFileResponse containing the list of files. content: application/json: schema: $ref: '#/components/schemas/ListOpenAIFileResponse' '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: - - Files - summary: List files. - description: >- - List files. - - Returns a list of files that belong to the user's organization. - 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: true post: + tags: + - V1 + summary: Openai Upload File + description: Response-only endpoint for proper schema generation. + operationId: openai_upload_file_v1_openai_v1_files_post responses: '200': - description: >- - An OpenAIFileObject representing the uploaded file. + description: An OpenAIFileObject representing the uploaded file. content: application/json: schema: $ref: '#/components/schemas/OpenAIFileObject' '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: - - 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: true /v1/openai/v1/files/{file_id}: - get: + delete: + tags: + - V1 + summary: Openai Delete File + description: Response-only endpoint for proper schema generation. + operationId: openai_delete_file_v1_openai_v1_files__file_id__delete responses: '200': - description: >- - An OpenAIFileObject containing file information. + description: An OpenAIFileDeleteResponse indicating successful deletion. content: application/json: schema: - $ref: '#/components/schemas/OpenAIFileObject' + $ref: '#/components/schemas/OpenAIFileDeleteResponse' '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: - - Files - summary: Retrieve file. - description: >- - Retrieve file. - - Returns information about a specific file. - parameters: - - name: file_id - in: path - description: >- - The ID of the file to use for this request. - required: true - schema: - type: string deprecated: true - delete: + get: + tags: + - V1 + summary: Openai Retrieve File + description: Response-only endpoint for proper schema generation. + operationId: openai_retrieve_file_v1_openai_v1_files__file_id__get responses: '200': - description: >- - An OpenAIFileDeleteResponse indicating successful deletion. + description: An OpenAIFileObject containing file information. content: application/json: schema: - $ref: '#/components/schemas/OpenAIFileDeleteResponse' + $ref: '#/components/schemas/OpenAIFileObject' '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: - - Files - summary: Delete file. - description: Delete file. - parameters: - - name: file_id - in: path - description: >- - The ID of the file to use for this request. - required: true - schema: - type: string deprecated: true /v1/openai/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_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 responses: '200': - description: >- - The raw file content as a binary response. + description: The raw file content as a binary response. content: application/json: - schema: - $ref: '#/components/schemas/Response' + 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: - - Files - summary: Retrieve file content. - description: >- - Retrieve file content. - - Returns the contents of the specified file. - parameters: - - name: file_id - in: path - description: >- - The ID of the file to use for this request. - required: true - schema: - type: string - deprecated: true + description: Default Response /v1/openai/v1/models: get: + tags: + - V1 + summary: Openai List Models + description: Response-only endpoint for proper schema generation. + operationId: openai_list_models_v1_openai_v1_models_get responses: '200': description: A OpenAIListModelsResponse. @@ -1436,23 +1236,25 @@ paths: schema: $ref: '#/components/schemas/OpenAIListModelsResponse' '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: - - Models - summary: List models using the OpenAI API. - description: List models using the OpenAI API. - parameters: [] deprecated: true /v1/openai/v1/moderations: post: + tags: + - V1 + summary: Run Moderation + description: Response-only endpoint for proper schema generation. + operationId: run_moderation_v1_openai_v1_moderations_post responses: '200': description: A moderation object. @@ -1461,32 +1263,25 @@ paths: schema: $ref: '#/components/schemas/ModerationObject' '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: - - 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: true /v1/openai/v1/responses: get: + tags: + - V1 + summary: List Openai Responses + description: Response-only endpoint for proper schema generation. + operationId: list_openai_responses_v1_openai_v1_responses_get responses: '200': description: A ListOpenAIResponseObject. @@ -1495,47 +1290,24 @@ paths: schema: $ref: '#/components/schemas/ListOpenAIResponseObject' '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: List all responses. - description: List all responses. - 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: true post: + tags: + - V1 + summary: Create Openai Response + description: Response-only endpoint for proper schema generation. + operationId: create_openai_response_v1_openai_v1_responses_post responses: '200': description: An OpenAIResponseObject. @@ -1543,107 +1315,79 @@ paths: application/json: schema: $ref: '#/components/schemas/OpenAIResponseObject' - text/event-stream: - schema: - $ref: '#/components/schemas/OpenAIResponseObjectStream' '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: Create a model response. - description: Create a model response. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateOpenaiResponseRequest' - required: true deprecated: true - 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/openai/v1/responses/{response_id}: - get: + delete: + tags: + - V1 + summary: Delete Openai Response + description: Response-only endpoint for proper schema generation. + operationId: delete_openai_response_v1_openai_v1_responses__response_id__delete responses: '200': - description: An OpenAIResponseObject. + description: An OpenAIDeleteResponseObject content: application/json: schema: - $ref: '#/components/schemas/OpenAIResponseObject' + $ref: '#/components/schemas/OpenAIDeleteResponseObject' '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: Get a model response. - description: Get a model response. - parameters: - - name: response_id - in: path - description: >- - The ID of the OpenAI response to retrieve. - required: true - schema: - type: string deprecated: true - delete: + get: + tags: + - V1 + summary: Get Openai Response + description: Response-only endpoint for proper schema generation. + operationId: get_openai_response_v1_openai_v1_responses__response_id__get responses: '200': - description: An OpenAIDeleteResponseObject + description: An OpenAIResponseObject. content: application/json: schema: - $ref: '#/components/schemas/OpenAIDeleteResponseObject' + $ref: '#/components/schemas/OpenAIResponseObject' '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: 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: true /v1/openai/v1/responses/{response_id}/input_items: get: + tags: + - V1 + summary: List Openai Response Input Items + description: Response-only endpoint for proper schema generation. + operationId: list_openai_response_input_items_v1_openai_v1_responses__response_id__input_items_get responses: '200': description: An ListOpenAIResponseInputItem. @@ -1652,778 +1396,466 @@ paths: schema: $ref: '#/components/schemas/ListOpenAIResponseInputItem' '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: 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: true /v1/openai/v1/vector_stores: get: + tags: + - V1 + summary: Openai List Vector Stores + description: Response-only endpoint for proper schema generation. + operationId: openai_list_vector_stores_v1_openai_v1_vector_stores_get responses: '200': - description: >- - A VectorStoreListResponse containing the list of vector stores. + description: A VectorStoreListResponse containing the list of vector stores. content: application/json: schema: $ref: '#/components/schemas/VectorStoreListResponse' '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: - - VectorIO - summary: Returns a list of vector stores. - description: Returns a 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 - 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: true post: + tags: + - V1 + summary: Openai Create Vector Store + description: Typed endpoint for proper schema generation. + operationId: openai_create_vector_store_v1_openai_v1_vector_stores_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAICreateVectorStoreRequestWithExtraBody' + required: true responses: '200': - description: >- - A VectorStoreObject representing the created vector store. + description: A VectorStoreObject representing the created vector store. content: application/json: schema: $ref: '#/components/schemas/VectorStoreObject' '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: - - 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' - required: true deprecated: true /v1/openai/v1/vector_stores/{vector_store_id}: - get: + delete: + tags: + - V1 + summary: Openai Delete Vector Store + description: Response-only endpoint for proper schema generation. + operationId: openai_delete_vector_store_v1_openai_v1_vector_stores__vector_store_id__delete responses: '200': - description: >- - A VectorStoreObject representing the vector store. + description: A VectorStoreDeleteResponse indicating the deletion status. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreObject' + $ref: '#/components/schemas/VectorStoreDeleteResponse' '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: - - VectorIO - summary: Retrieves a vector store. - description: Retrieves a vector store. - parameters: - - name: vector_store_id - in: path - description: The ID of the vector store to retrieve. - required: true - schema: - type: string deprecated: true - post: + get: + tags: + - V1 + summary: Openai Retrieve Vector Store + description: Response-only endpoint for proper schema generation. + operationId: openai_retrieve_vector_store_v1_openai_v1_vector_stores__vector_store_id__get responses: '200': - description: >- - A VectorStoreObject representing the updated vector store. + description: A VectorStoreObject representing the vector store. content: application/json: schema: $ref: '#/components/schemas/VectorStoreObject' '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: - - 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 - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenaiUpdateVectorStoreRequest' - required: true deprecated: true - delete: + post: + tags: + - V1 + summary: Openai Update Vector Store + description: Response-only endpoint for proper schema generation. + operationId: openai_update_vector_store_v1_openai_v1_vector_stores__vector_store_id__post responses: '200': - description: >- - A VectorStoreDeleteResponse indicating the deletion status. + description: A VectorStoreObject representing the updated vector store. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreDeleteResponse' + $ref: '#/components/schemas/VectorStoreObject' '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: - - VectorIO - summary: Delete a vector store. - description: Delete a vector store. - parameters: - - name: vector_store_id - in: path - description: The ID of the vector store to delete. - required: true - schema: - type: string deprecated: true /v1/openai/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_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. + 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': - $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: - - 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. - 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' - required: true deprecated: true /v1/openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}: get: + tags: + - V1 + summary: Openai Retrieve Vector Store File Batch + description: Response-only 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 responses: '200': - description: >- - A VectorStoreFileBatchObject representing the file batch. + description: A VectorStoreFileBatchObject representing the file batch. content: application/json: schema: $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' - tags: - - VectorIO - summary: Retrieve a vector store file batch. - description: Retrieve a vector store 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 - description: >- - The ID of the vector store containing the file batch. - required: true - schema: - type: string deprecated: true /v1/openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel: post: + tags: + - V1 + summary: Openai Cancel Vector Store File Batch + description: Response-only 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 responses: '200': - description: >- - A VectorStoreFileBatchObject representing the cancelled file batch. + 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': - $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: - - VectorIO - summary: Cancels a vector store file batch. - description: Cancels a vector store 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 - description: >- - The ID of the vector store containing the file batch. - required: true - schema: - type: string deprecated: true /v1/openai/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/files: get: + tags: + - V1 + summary: Openai List Files In Vector Store File Batch + description: Response-only 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 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: $ref: '#/components/schemas/VectorStoreFilesListInBatchResponse' '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: - - VectorIO - summary: >- - Returns a list of vector store files in a batch. - description: >- - Returns a list of vector store files in a 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 - 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: true /v1/openai/v1/vector_stores/{vector_store_id}/files: get: + tags: + - V1 + summary: Openai List Files In Vector Store + description: Response-only endpoint for proper schema generation. + operationId: openai_list_files_in_vector_store_v1_openai_v1_vector_stores__vector_store_id__files_get responses: '200': - description: >- - A VectorStoreListFilesResponse containing the list of files. + description: A VectorStoreListFilesResponse containing the list of files. content: application/json: schema: $ref: '#/components/schemas/VectorStoreListFilesResponse' '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: - - VectorIO - summary: List files in a vector store. - description: List files in a vector store. - 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: true post: + tags: + - V1 + summary: Openai Attach File To Vector Store + description: Response-only endpoint for proper schema generation. + operationId: openai_attach_file_to_vector_store_v1_openai_v1_vector_stores__vector_store_id__files_post responses: '200': - description: >- - A VectorStoreFileObject representing the attached file. + description: A VectorStoreFileObject representing the attached file. content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileObject' '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: - - VectorIO - summary: Attach a file to a vector store. - description: Attach a file to a vector store. - 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' - required: true deprecated: true /v1/openai/v1/vector_stores/{vector_store_id}/files/{file_id}: - get: + delete: + tags: + - V1 + summary: Openai Delete Vector Store File + description: Response-only endpoint for proper schema generation. + operationId: openai_delete_vector_store_file_v1_openai_v1_vector_stores__vector_store_id__files__file_id__delete responses: '200': - description: >- - A VectorStoreFileObject representing the file. + description: A VectorStoreFileDeleteResponse indicating the deletion status. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFileObject' + $ref: '#/components/schemas/VectorStoreFileDeleteResponse' '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: - - VectorIO - summary: Retrieves a vector store file. - description: Retrieves 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: true - post: + get: + tags: + - V1 + summary: Openai Retrieve Vector Store File + description: Response-only endpoint for proper schema generation. + operationId: openai_retrieve_vector_store_file_v1_openai_v1_vector_stores__vector_store_id__files__file_id__get responses: '200': - description: >- - A VectorStoreFileObject representing the updated file. + description: A VectorStoreFileObject representing the file. content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileObject' '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: - - VectorIO - summary: Updates a vector store file. - description: Updates a vector store 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 - description: The ID of the file to update. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenaiUpdateVectorStoreFileRequest' - required: true deprecated: true - delete: + post: + tags: + - V1 + summary: Openai Update Vector Store File + description: Response-only endpoint for proper schema generation. + operationId: openai_update_vector_store_file_v1_openai_v1_vector_stores__vector_store_id__files__file_id__post responses: '200': - description: >- - A VectorStoreFileDeleteResponse indicating the deletion status. + description: A VectorStoreFileObject representing the updated file. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFileDeleteResponse' + $ref: '#/components/schemas/VectorStoreFileObject' '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: - - 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: true /v1/openai/v1/vector_stores/{vector_store_id}/files/{file_id}/content: get: + tags: + - V1 + summary: Openai Retrieve Vector Store File Contents + description: Response-only 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 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': + 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: - - 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: true /v1/openai/v1/vector_stores/{vector_store_id}/search: post: + tags: + - V1 + summary: Openai Search Vector Store + description: Response-only endpoint for proper schema generation. + operationId: openai_search_vector_store_v1_openai_v1_vector_stores__vector_store_id__search_post 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': + 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: - - 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: true /v1/post-training/job/artifacts: get: + tags: + - V1 + summary: Get Training Job Artifacts + description: Response-only endpoint for proper schema generation. + operationId: get_training_job_artifacts_v1_post_training_job_artifacts_get responses: '200': description: A PostTrainingJobArtifactsResponse. @@ -2432,57 +1864,62 @@ paths: schema: $ref: '#/components/schemas/PostTrainingJobArtifactsResponse' '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 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: true /v1/post-training/job/cancel: post: + tags: + - V1 + summary: Cancel 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: 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: true + description: Default Response /v1/post-training/job/status: get: + tags: + - V1 + summary: Get Training Job Status + description: Response-only endpoint for proper schema generation. + operationId: get_training_job_status_v1_post_training_job_status_get responses: '200': description: A PostTrainingJobStatusResponse. @@ -2491,30 +1928,25 @@ paths: schema: $ref: '#/components/schemas/PostTrainingJobStatusResponse' '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 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: true /v1/post-training/jobs: get: + tags: + - V1 + summary: Get Training Jobs + description: Response-only endpoint for proper schema generation. + operationId: get_training_jobs_v1_post_training_jobs_get responses: '200': description: A ListPostTrainingJobsResponse. @@ -2523,23 +1955,31 @@ 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: true /v1/post-training/preference-optimize: post: + tags: + - V1 + summary: Preference Optimize + 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. @@ -2548,29 +1988,31 @@ 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' + deprecated: true + /v1/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: [] + - V1 + summary: Supervised Fine Tune + 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/PreferenceOptimizeRequest' + $ref: '#/components/schemas/TrainingConfig' required: true - deprecated: true - /v1/post-training/supervised-fine-tune: - post: responses: '200': description: A PostTrainingJob. @@ -2579,7621 +2021,7152 @@ 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: true -jsonSchemaDialect: >- - https://json-schema.org/draft/2020-12/schema components: schemas: - Error: - type: object + Agent: 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: + agent_id: type: string - description: >- - Error detail, a longer human-readable description of the error - instance: + title: Agent Id + agent_config: + $ref: '#/components/schemas/AgentConfig-Output' + created_at: 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. - PaginatedResponse: + format: date-time + title: Created At type: object - 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: - type: string - description: The URL for accessing this list - additionalProperties: false required: - - data - - has_more - title: PaginatedResponse - description: >- - A generic paginated response that follows a simple format. - AgentConfig: - type: object + - agent_id + - agent_config + - created_at + title: 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' + AgentConfig-Input: properties: sampling_params: - $ref: '#/components/schemas/SamplingParams' + anyOf: + - $ref: '#/components/schemas/SamplingParams' + - type: 'null' input_shields: - type: array - items: - type: string + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Input Shields output_shields: - type: array - items: - type: string + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Output Shields toolgroups: - type: array - items: - $ref: '#/components/schemas/AgentTool' + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + type: array + - type: 'null' + title: Toolgroups client_tools: - type: array - items: - $ref: '#/components/schemas/ToolDef' + anyOf: + - items: + $ref: '#/components/schemas/ToolDef' + type: array + - type: 'null' + title: Client Tools 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. + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: 'null' deprecated: true tool_prompt_format: - type: string - enum: - - json - - function_tag - - python_list - title: ToolPromptFormat - description: >- - Prompt format for calling custom / zero shot tools. + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' deprecated: true tool_config: - $ref: '#/components/schemas/ToolConfig' + anyOf: + - $ref: '#/components/schemas/ToolConfig' + - type: 'null' max_infer_iters: - type: integer + anyOf: + - type: integer + - type: 'null' + title: Max Infer Iters default: 10 model: type: string - description: >- - The model identifier to use for the agent + title: Model instructions: type: string - description: The system instructions for the agent + title: Instructions name: - type: string - description: >- - Optional name for the agent, used in telemetry and identification + anyOf: + - type: string + - type: 'null' + title: Name enable_session_persistence: - type: boolean + anyOf: + - type: boolean + - type: 'null' + title: Enable Session Persistence 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 + 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 required: - - model - - instructions + - 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 + 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' + AgentConfig-Output: 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 + 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 - - 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: + - $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 + instructions: + type: string + 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 + required: + - 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: - type: + agent_id: 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: 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' + AgentSessionCreateResponse: properties: - type: + session_id: 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: + 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' + AgentStepResponse: properties: - strategy: + step: oneOf: - - $ref: '#/components/schemas/GreedySamplingStrategy' - - $ref: '#/components/schemas/TopPSamplingStrategy' - - $ref: '#/components/schemas/TopKSamplingStrategy' + - $ref: '#/components/schemas/InferenceStep-Output' + - $ref: '#/components/schemas/ToolExecutionStep-Output' + - $ref: '#/components/schemas/ShieldCallStep-Output' + - $ref: '#/components/schemas/MemoryRetrievalStep-Output' + title: Step discriminator: - propertyName: type + propertyName: step_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: + 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. + + + :param step: The complete step data and execution details' + 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' + Batch: 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: + id: 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: + title: Id + completion_window: 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: + title: Completion Window + created_at: + type: integer + title: Created At + endpoint: type: string - description: >- - (Optional) ID of the tool group this tool belongs to - name: + title: Endpoint + input_file_id: type: string - description: Name of the tool - description: + title: Input File Id + object: 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) + 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: - 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 + 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: - type: - type: string - const: top_k - default: top_k - description: >- - Must be "top_k" to identify this sampling strategy - top_k: + 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 + BatchUsage: + properties: + input_tokens: 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: + 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: + 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: 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: + const: benchmark + title: Type + default: benchmark + dataset_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: + 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. + + + :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' + BuiltinTool: + type: string + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + Checkpoint: properties: - agent_id: + identifier: type: string - description: Unique identifier for the agent - agent_config: - $ref: '#/components/schemas/AgentConfig' - description: Configuration settings for the agent + title: Identifier 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: + title: Created At + epoch: + type: integer + title: Epoch + post_training_job_id: type: string - description: The name of the session to create. - additionalProperties: false - required: - - session_name - title: CreateAgentSessionRequest - AgentSessionCreateResponse: + title: Post Training Job Id + path: + type: string + title: Path + training_metrics: + anyOf: + - $ref: '#/components/schemas/PostTrainingMetric' + - type: 'null' type: object + required: + - identifier + - created_at + - epoch + - post_training_job_id + - path + title: 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' + Chunk-Input: properties: - session_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 + metadata: + additionalProperties: true + type: object + title: Metadata + 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: '#/components/schemas/ChunkMetadata' + - type: 'null' + type: object + required: + - content + 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 embedding: Optional embedding for the chunk. If\ + \ not provided, it will be computed later.\n:param metadata: Metadata associated\ + \ with the chunk that will be used in the model context during inference.\n\ + :param stored_chunk_id: The chunk ID that is stored in the vector database.\ + \ Used for backend functionality.\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." + 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 + metadata: + additionalProperties: true + type: object + title: Metadata + 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: '#/components/schemas/ChunkMetadata' + - type: 'null' + type: object + required: + - content + 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 embedding: Optional embedding for the chunk. If\ + \ not provided, it will be computed later.\n:param metadata: Metadata associated\ + \ with the chunk that will be used in the model context during inference.\n\ + :param stored_chunk_id: The chunk ID that is stored in the vector database.\ + \ Used for backend functionality.\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: + 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.\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." + CompletionMessage-Input: + properties: + role: 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: + 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: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." + CompletionMessage-Output: properties: role: type: string const: assistant + title: Role 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 + 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: - 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. + $ref: '#/components/schemas/StopReason' tool_calls: - type: array - items: - $ref: '#/components/schemas/ToolCall' - description: >- - List of tool calls. Each tool call is a ToolCall object. - additionalProperties: false + anyOf: + - items: + $ref: '#/components/schemas/ToolCall' + type: array + - type: 'null' + title: Tool Calls + type: object required: - - role - - content - - stop_reason + - content + - stop_reason title: CompletionMessage - description: >- - A message containing the model's (assistant) response in a chat conversation. - ImageContentItem: - type: object + 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: - type: + id: 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: + 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 - 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 + - 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. + ConversationDeletedResource: 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: type: string - format: date-time - description: The time the step completed. - step_type: + title: Id + description: The deleted conversation identifier + object: 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: + 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. + ConversationItemDeletedResource: 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: + id: 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: + title: Id + description: The deleted item identifier + object: 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: + 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. + ConversationItemList: properties: - violation_level: - $ref: '#/components/schemas/ViolationLevel' - description: Severity level of the violation - user_message: + object: type: string - description: >- - (Optional) Message to convey to the user about the violation - metadata: - type: object - additionalProperties: + title: Object + description: Object type + default: list + data: + items: 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: + - $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. + DPOLossType: + type: string + enum: + - sigmoid + - hinge + - ipo + - kto_pair + title: DPOLossType + DataConfig: 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: + dataset_id: 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: + 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: - turn_id: - type: string - description: The ID of the turn. - step_id: + identifier: type: string - description: The ID of the step. - started_at: + 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 - format: date-time - description: The time the step started. - completed_at: + title: Provider Id + description: ID of the provider that owns this resource + type: 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 + 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: - - turn_id - - step_id - - step_type - title: ShieldCallStep - description: A shield call step in an agent turn. - TextContentItem: + - 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 }" + 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' + GrammarResponseFormat: 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 + const: grammar + title: Type + default: grammar + bnf: + additionalProperties: true + type: object + title: Bnf + type: object required: - - type - - text - title: TextContentItem - description: A text content item - ToolCall: + - 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' + HealthStatus: + type: string + enum: + - OK + - Error + - Not Implemented + title: HealthStatus + InferenceStep-Input: properties: - call_id: + turn_id: type: string - tool_name: - oneOf: - - type: string - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - - type: string - arguments: + title: Turn Id + step_id: type: string - additionalProperties: false - required: - - call_id - - tool_name - - arguments - title: ToolCall - ToolExecutionStep: + title: Step Id + 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 + 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. + + + :param model_response: The response from the LLM.' + InferenceStep-Output: properties: turn_id: type: string - description: The ID of the turn. + title: Turn Id step_id: type: string - description: The ID of the step. + title: Step Id started_at: - type: string - format: date-time - description: The time the step started. + anyOf: + - type: string + format: date-time + - type: 'null' + title: Started At completed_at: - type: string - format: date-time - description: The time the step completed. + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At 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: + 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.' + 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: - call_id: + type: 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: + const: json_schema + title: Type + default: json_schema + json_schema: + additionalProperties: true 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: + title: Json Schema 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 + - 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: - turn_id: + type: type: string - description: >- - Unique identifier for the turn within a session - session_id: + const: llm_as_judge + title: Type + default: llm_as_judge + judge_model: type: string - description: >- - Unique identifier for the conversation session - input_messages: - type: array + title: Judge Model + prompt_template: + anyOf: + - type: string + - type: 'null' + title: Prompt Template + judge_score_regexes: items: - oneOf: - - $ref: '#/components/schemas/UserMessage' - - $ref: '#/components/schemas/ToolResponseMessage' - description: >- - List of messages that initiated this turn - steps: + type: string type: array + title: Judge Score Regexes + description: Regexes to extract the answer from generated response + aggregation_functions: 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 - output_message: - $ref: '#/components/schemas/CompletionMessage' - description: >- - The model's generated response containing content and metadata - output_attachments: + $ref: '#/components/schemas/AggregationFunctionType' 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: + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row 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: - type: object + - 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' + ListBatchesResponse: properties: - role: + object: 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 - 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 + const: list + title: Object + default: list + data: 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: + $ref: '#/components/schemas/Batch' 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: + 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 - 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: - type: object + - data + title: ListBatchesResponse + description: Response containing a list of batch objects. + ListOpenAIChatCompletionResponse: properties: - event_type: + data: + items: + $ref: '#/components/schemas/OpenAICompletionWithInputMessages' + type: array + title: Data + has_more: + type: boolean + title: Has More + first_id: 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: + title: First Id + last_id: type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - description: Type of step being executed - step_id: + title: Last Id + object: 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: + const: list + title: Object + default: list 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 - 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' - 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 + - data + - has_more + - first_id + - last_id + title: 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' + ListOpenAIFileResponse: properties: - event_type: + data: + items: + $ref: '#/components/schemas/OpenAIFileObject' + type: array + title: Data + has_more: + type: boolean + title: Has More + first_id: 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: + title: First Id + last_id: type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - description: Type of step being executed - step_id: + title: Last Id + object: type: string - description: >- - Unique identifier for the step within a turn - metadata: - 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: + const: list + title: Object + default: list 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 + - data + - has_more + - first_id + - last_id + title: 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"' + ListOpenAIResponseObject: 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: + data: + items: + $ref: '#/components/schemas/OpenAIResponseObjectWithInput-Output' + type: array + title: Data + has_more: + type: boolean + title: Has More + first_id: 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: + title: First Id + last_id: 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: + title: Last Id + object: type: string - 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: + const: list + title: Object + default: list type: object - properties: - type: - type: string - const: image - 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: - type: object + - data + - has_more + - first_id + - last_id + title: 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"' + MemoryRetrievalStep-Input: properties: - type: + turn_id: type: string - const: text - default: text - description: >- - Discriminator type of the delta. Always "text" - text: + title: Turn Id + step_id: 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: + title: Step Id + 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 + step_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: + const: memory_retrieval + title: Step Type + default: memory_retrieval + vector_store_ids: 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: + 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 - 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 - 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. - AppendRowsRequest: - type: object + - 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.' + MemoryRetrievalStep-Output: properties: - rows: - type: array - items: - type: object - additionalProperties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + 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 + 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: - - 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 - Dataset: + - $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.' + 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: dataset - default: dataset - description: >- - Type of resource, always 'dataset' for datasets - purpose: - 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 + 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: 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 + 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. + + + :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' + ModelCandidate: properties: type: type: string - const: uri - default: uri - uri: + const: model + title: Type + default: model + model: 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: + title: Model + sampling_params: + $ref: '#/components/schemas/SamplingParams' + system_message: + anyOf: + - $ref: '#/components/schemas/SystemMessage' + - type: 'null' type: object + required: + - 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.' + 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' + ModerationObjectResults: 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!"}, ] - } ] } + flagged: + type: boolean + title: Flagged + 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 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 - Benchmark: + 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.' + OpenAIAssistantMessageParam-Input: 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 - 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: - 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 - properties: - type: - $ref: '#/components/schemas/ScoringFnParamsType' - const: basic - 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 - 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: - 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. - ModelCandidate: - type: object - 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. - 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. - 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: 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 - 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 - 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: - 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. - 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 - 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. - Order: - type: string - enum: - - asc - - desc - title: Order - 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: - type: object - properties: - role: + role: type: string const: assistant + title: Role 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 + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + - type: 'null' + title: Content name: - type: string - description: >- - (Optional) The name of the assistant message participant. + anyOf: + - type: string + - type: 'null' + title: Name 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 + 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 + 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 - 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: - type: object - properties: - name: - type: string - description: (Optional) Name of the function to call - arguments: - 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: - 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' - 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 - 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 - 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 + + + :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 - const: system - default: system - description: >- - Must be "system" to identify this as a system message + const: assistant + title: Role + default: assistant 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). + anyOf: + - type: string + - items: + $ref: '#/components/schemas/OpenAIChatCompletionContentPartTextParam' + type: array + - type: 'null' + title: Content 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: + anyOf: + - type: string + - type: 'null' + title: Name + tool_calls: + anyOf: + - items: + $ref: '#/components/schemas/OpenAIChatCompletionToolCall' + type: array + - type: 'null' + title: Tool Calls type: object - properties: - role: - type: string - const: tool - default: tool - description: >- - Must be "tool" to identify this as a tool response - tool_call_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 + title: OpenAIAssistantMessageParam + description: 'A message containing the model''s (assistant) response in an OpenAI-compatible chat completion request. - OpenAITopLogProb: - type: object + + + :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: - token: + id: type: string - bytes: - type: array + title: Id + choices: 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: + $ref: '#/components/schemas/OpenAIChoice-Output' + type: array + title: Choices + object: 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: - type: object - properties: - type: + const: chat.completion + title: Object + default: chat.completion + created: + type: integer + title: Created + model: 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: + title: Model + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsage' + - type: 'null' 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' - 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: + - 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: + 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. + + + :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 - description: >- - Must be "text" to indicate plain text response format - additionalProperties: false + text: + type: string + title: Text + type: object required: - - type - title: OpenAIResponseFormatText - description: >- - Text response format for OpenAI-compatible chat completion requests. + - 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: - 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. + title: Model messages: - type: array items: - $ref: '#/components/schemas/OpenAIMessageParam' - description: List of messages in the conversation. + 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: - type: number - description: >- - (Optional) The penalty for repeated tokens. + anyOf: + - type: number + - type: 'null' + title: Frequency Penalty 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: + anyOf: + - type: string + - additionalProperties: true type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) List of functions to use. + - type: 'null' + title: Function Call + functions: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + title: Functions logit_bias: - type: object - additionalProperties: - type: number - description: (Optional) The logit bias to use. + anyOf: + - additionalProperties: + type: number + type: object + - type: 'null' + title: Logit Bias logprobs: - type: boolean - description: (Optional) The log probabilities to use. + anyOf: + - type: boolean + - type: 'null' + title: Logprobs max_completion_tokens: - type: integer - description: >- - (Optional) The maximum number of tokens to generate. + anyOf: + - type: integer + - type: 'null' + title: Max Completion Tokens max_tokens: - type: integer - description: >- - (Optional) The maximum number of tokens to generate. + anyOf: + - type: integer + - type: 'null' + title: Max Tokens n: - type: integer - description: >- - (Optional) The number of completions to generate. + anyOf: + - type: integer + - type: 'null' + title: N parallel_tool_calls: - type: boolean - description: >- - (Optional) Whether to parallelize tool calls. + anyOf: + - type: boolean + - type: 'null' + title: Parallel Tool Calls presence_penalty: - type: number - description: >- - (Optional) The penalty for repeated tokens. + anyOf: + - type: number + - type: 'null' + title: Presence Penalty response_format: - $ref: '#/components/schemas/OpenAIResponseFormatParam' - description: (Optional) The response format to use. + 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: - type: integer - description: (Optional) The seed to use. + anyOf: + - type: integer + - type: 'null' + title: Seed stop: - oneOf: - - type: string - - type: array - items: - type: string - description: (Optional) The stop tokens to use. + anyOf: + - type: string + - items: + type: string + type: array + - type: 'null' + title: Stop stream: - type: boolean - description: >- - (Optional) Whether to stream the response. + anyOf: + - type: boolean + - type: 'null' + title: Stream 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. + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Stream Options temperature: - type: number - description: (Optional) The temperature to use. + anyOf: + - type: number + - type: 'null' + title: Temperature 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: + anyOf: + - type: string + - additionalProperties: true type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: (Optional) The tools to use. + - type: 'null' + title: Tool Choice + tools: + anyOf: + - items: + additionalProperties: true + type: object + type: array + - type: 'null' + title: Tools top_logprobs: - type: integer - description: >- - (Optional) The top log probabilities to use. + anyOf: + - type: integer + - type: 'null' + title: Top Logprobs top_p: - type: number - description: (Optional) The top p to use. + anyOf: + - type: number + - type: 'null' + title: Top P user: - type: string - description: (Optional) The user to use. - additionalProperties: false + anyOf: + - type: string + - type: 'null' + title: User + additionalProperties: true + type: object required: - - model - - messages + - model + - messages title: OpenAIChatCompletionRequestWithExtraBody - description: >- - Request parameters for OpenAI-compatible chat completion endpoint. - OpenAIChatCompletion: - type: object + 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 - description: The ID of the chat completion - choices: - type: array - items: - $ref: '#/components/schemas/OpenAIChoice' - description: List of choices - object: + 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: + 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 + 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. + + + :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' + 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 - const: chat.completion - default: chat.completion - description: >- - The object type, which will be "chat.completion" - created: + title: Finish Reason + index: type: integer - description: >- - The Unix timestamp in seconds when the chat completion was created - model: + 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. + + + :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' + 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 - 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: 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. + + + :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-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. + + + :param content: (Optional) The log probabilities for the tokens in the message + + :param refusal: (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: The ID of the chat completion + title: Id 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: '#/components/schemas/OpenAICompletionChoice-Output' + type: array + title: Choices created: type: integer - description: >- - The Unix timestamp in seconds when the chat completion was created + title: 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: 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. + + + :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-Input: properties: - content: - type: string - description: (Optional) The content of the delta - refusal: + finish_reason: type: string - description: (Optional) The refusal of the delta - role: + title: Finish Reason + text: 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 + 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. + + + :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' + OpenAICompletionChoice-Output: + properties: finish_reason: type: string - description: The reason the model stopped generating + title: Finish Reason + text: + type: string + title: Text index: type: integer - description: The index of the choice + title: Index 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: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' + - type: 'null' 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 + 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: - 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. + title: Model prompt: - oneOf: - - type: string - - type: array - items: - type: string - - type: array + anyOf: + - type: string + - items: + type: string + type: array + - items: + type: integer + type: array + - items: items: type: integer - - type: array - items: - type: array - items: - type: integer - description: The prompt to generate a completion for. + type: array + type: array + title: Prompt best_of: - type: integer - description: >- - (Optional) The number of completions to generate. + anyOf: + - type: integer + - type: 'null' + title: Best Of echo: - type: boolean - description: (Optional) Whether to echo the prompt. + anyOf: + - type: boolean + - type: 'null' + title: Echo frequency_penalty: - type: number - description: >- - (Optional) The penalty for repeated tokens. + anyOf: + - type: number + - type: 'null' + title: Frequency Penalty logit_bias: - type: object - additionalProperties: - type: number - description: (Optional) The logit bias to use. + anyOf: + - additionalProperties: + type: number + type: object + - type: 'null' + title: Logit Bias logprobs: - type: boolean - description: (Optional) The log probabilities to use. + anyOf: + - type: boolean + - type: 'null' + title: Logprobs max_tokens: - type: integer - description: >- - (Optional) The maximum number of tokens to generate. + anyOf: + - type: integer + - type: 'null' + title: Max Tokens n: - type: integer - description: >- - (Optional) The number of completions to generate. + anyOf: + - type: integer + - type: 'null' + title: N presence_penalty: - type: number - description: >- - (Optional) The penalty for repeated tokens. + anyOf: + - type: number + - type: 'null' + title: Presence Penalty seed: - type: integer - description: (Optional) The seed to use. + anyOf: + - type: integer + - type: 'null' + title: Seed stop: - oneOf: - - type: string - - type: array - items: - type: string - description: (Optional) The stop tokens to use. + anyOf: + - type: string + - items: + type: string + type: array + - type: 'null' + title: Stop stream: - type: boolean - description: >- - (Optional) Whether to stream the response. + anyOf: + - type: boolean + - type: 'null' + title: Stream 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. + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Stream Options temperature: - type: number - description: (Optional) The temperature to use. + anyOf: + - type: number + - type: 'null' + title: Temperature top_p: - type: number - description: (Optional) The top p to use. + anyOf: + - type: number + - type: 'null' + title: Top P user: - type: string - description: (Optional) The user to use. + anyOf: + - type: string + - type: 'null' + title: User suffix: - type: string - description: >- - (Optional) The suffix that should be appended to the completion. - additionalProperties: false + anyOf: + - type: string + - type: 'null' + title: Suffix + additionalProperties: true + type: object required: - - model - - prompt + - model + - prompt title: OpenAICompletionRequestWithExtraBody - description: >- - Request parameters for OpenAI-compatible completion endpoint. - OpenAICompletion: - type: object + 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.' + OpenAICompletionWithInputMessages: properties: id: type: string + title: Id choices: - type: array items: - $ref: '#/components/schemas/OpenAICompletionChoice' + $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 - 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: + 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: - finish_reason: - type: string - text: - type: string - index: - type: integer - logprobs: - $ref: '#/components/schemas/OpenAIChoiceLogprobs' - additionalProperties: false + 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: - - finish_reason - - text - - index - title: OpenAICompletionChoice - description: >- - A choice from an OpenAI-compatible completion response. - OpenAIEmbeddingsRequestWithExtraBody: + - 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: + 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. + + + :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' + OpenAIDeleteResponseObject: properties: - model: + id: 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: + title: Id + object: 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: + const: response + title: Object + default: response + deleted: + type: boolean + title: Deleted + default: true + type: object + required: + - id + title: 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' + OpenAIDeveloperMessageParam: + properties: + role: type: string - description: >- - (Optional) A unique identifier representing your end-user, which can help - OpenAI to monitor and detect abuse. - additionalProperties: false + 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: - - model - - input - title: OpenAIEmbeddingsRequestWithExtraBody - description: >- - Request parameters for OpenAI-compatible embeddings endpoint. + - 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: - type: object properties: object: type: string const: embedding + title: Object 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") + anyOf: + - items: + type: number + type: array + - type: string + title: Embedding index: type: integer - description: >- - The index of the embedding in the input list - additionalProperties: false + title: Index + type: object required: - - object - - embedding - - index + - embedding + - index title: OpenAIEmbeddingData - description: >- - A single embedding data object from an OpenAI-compatible embeddings response. + 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: - type: object properties: prompt_tokens: type: integer - description: The number of tokens in the input + title: Prompt Tokens total_tokens: type: integer - description: The total number of tokens used - additionalProperties: false + title: Total Tokens + type: object required: - - prompt_tokens - - total_tokens + - prompt_tokens + - total_tokens title: OpenAIEmbeddingUsage - description: >- - Usage information for an OpenAI-compatible embeddings response. - OpenAIEmbeddingsResponse: - type: object + 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: - 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: + 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 - 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 + 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 - 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: + 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 - description: The object type, which is always "file" id: type: string - description: >- - The file identifier, which can be referenced in the API endpoints + title: Id bytes: type: integer - description: The size of the file, in bytes + title: Bytes created_at: type: integer - description: >- - The Unix timestamp (in seconds) for when the file was created + title: Created At expires_at: type: integer - description: >- - The Unix timestamp (in seconds) for when the file expires + title: Expires At filename: type: string - description: The name of the file + title: Filename 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: + $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: - anchor: + url: type: string - const: created_at - seconds: - type: integer - additionalProperties: false + title: Url + detail: + anyOf: + - type: string + - type: 'null' + title: Detail + type: object required: - - anchor - - seconds - title: ExpiresAfter - description: >- - Control expiration of uploaded files. + - url + title: OpenAIImageURL + description: 'Image URL specification for OpenAI-compatible chat completion + messages. - Params: - - anchor, must be "created_at" - - seconds, must be int between 3600 and 2592000 (1 hour to 30 days) - OpenAIFileDeleteResponse: - type: object + + :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: - id: - type: string - description: The file identifier that was deleted - object: + name: 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 - OpenAIModel: + 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' + 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 - 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 - 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 - ModerationObject: - type: object - properties: - id: - type: string - description: >- - The unique identifier for the moderation request. - model: - type: string - 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: + title: Owned By type: object - properties: - flagged: - type: boolean - 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. - 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. - category_scores: - type: object - additionalProperties: - type: number - description: >- - A list of the categories along with their scores as predicted by model. - user_message: - type: string - metadata: - 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. - ListOpenAIResponseObject: - type: object - 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: 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 - required: - - data - - has_more - - first_id - - last_id - - object - title: ListOpenAIResponseObject - description: >- - Paginated list of OpenAI response objects with navigation metadata. + - id + - created + - owned_by + title: OpenAIModel + description: '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' OpenAIResponseAnnotationCitation: - type: object properties: type: type: string const: url_citation + title: Type default: url_citation - description: >- - Annotation type identifier, always "url_citation" end_index: type: integer - description: >- - End position of the citation span in the content + title: End Index start_index: type: integer - description: >- - Start position of the citation span in the content + title: Start Index title: type: string - description: Title of the referenced web resource + title: Title url: type: string - description: URL of the referenced web resource - additionalProperties: false + title: Url + type: object required: - - type - - end_index - - start_index - - title - - url + - end_index + - start_index + - title + - url title: OpenAIResponseAnnotationCitation - description: >- - URL citation annotation for referencing external web resources. - "OpenAIResponseAnnotationContainerFileCitation": - type: object + 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 - additionalProperties: false - required: - - type - - container_id - - end_index - - file_id - - filename - - start_index - title: >- - OpenAIResponseAnnotationContainerFileCitation - OpenAIResponseAnnotationFileCitation: + 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 - description: >- - Annotation type identifier, always "file_citation" file_id: type: string - description: Unique identifier of the referenced file + title: File Id filename: type: string - description: Name of the referenced file + title: Filename index: type: integer - description: >- - Position index of the citation within the content - additionalProperties: false - required: - - type - - file_id - - filename - - index + title: Index + type: object + required: + - file_id + - filename + - index title: OpenAIResponseAnnotationFileCitation - description: >- - File citation annotation for referencing specific files in response content. + 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: - type: object properties: type: type: string const: file_path + title: Type default: file_path file_id: type: string + title: File Id index: type: integer - additionalProperties: false + title: Index + type: object required: - - type - - file_id - - index + - 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 + title: Type default: refusal - description: >- - Content part type identifier, always "refusal" refusal: type: string - description: Refusal text supplied by the model - additionalProperties: false + title: Refusal + type: object required: - - type - - refusal + - refusal title: OpenAIResponseContentPartRefusal - description: >- - Refusal content within a streamed response part. + description: 'Refusal content within a streamed response part. + + + :param type: Content part type identifier, always "refusal" + + :param refusal: Refusal text supplied by the model' OpenAIResponseError: - type: object properties: code: type: string - description: >- - Error code identifying the type of failure + title: Code message: type: string - description: >- - Human-readable error message describing the failure - additionalProperties: false + title: Message + type: object required: - - code - - message + - 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' - "OpenAIResponseInputFunctionToolCallOutput": + 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: + 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: - type: string + anyOf: + - type: string + - type: 'null' + title: Id 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: + 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 - 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. + anyOf: + - type: string + - type: 'null' + title: File Data file_id: - type: string - description: >- - (Optional) The ID of the file to be sent to the model. + anyOf: + - type: string + - type: 'null' + title: File Id file_url: - type: string - description: >- - The URL of the file to be sent to the model. + anyOf: + - type: string + - type: 'null' + title: File Url filename: - type: string - description: >- - The name of the file to be sent to the model. - additionalProperties: false - required: - - type + anyOf: + - type: string + - type: 'null' + title: Filename + type: object title: OpenAIResponseInputMessageContentFile - description: >- - File content for input messages in OpenAI response format. + 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: - type: object properties: detail: - oneOf: - - type: string - const: low - - type: string - const: high - - type: string - const: auto + anyOf: + - type: string + const: low + - type: string + const: high + - type: string + const: auto + title: Detail default: auto - description: >- - Level of detail for image processing, can be "low", "high", or "auto" type: type: string const: input_image + title: Type 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. + anyOf: + - type: string + - type: 'null' + title: File Id image_url: - type: string - description: (Optional) URL of the image content - additionalProperties: false - required: - - detail - - type + anyOf: + - type: string + - type: 'null' + title: Image Url + type: object title: OpenAIResponseInputMessageContentImage - description: >- - Image content for input messages in OpenAI response format. + 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: - type: object properties: text: type: string - description: The text content of the input message + title: Text type: type: string const: input_text + title: Type default: input_text - description: >- - Content type identifier, always "input_text" - additionalProperties: false + type: object required: - - text - - type + - text title: OpenAIResponseInputMessageContentText - description: >- - Text content for input messages in OpenAI response format. + 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: - type: object properties: type: type: string const: file_search + title: Type 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 + type: array + title: Vector Store Ids 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 + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Filters max_num_results: - type: integer + anyOf: + - type: integer + maximum: 50.0 + minimum: 1.0 + - type: 'null' + title: Max Num Results 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 + anyOf: + - $ref: '#/components/schemas/SearchRankingOptions' + - type: 'null' + type: object + required: + - vector_store_ids title: OpenAIResponseInputToolFileSearch - description: >- - File search tool configuration for OpenAI response inputs. + 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: - type: object properties: type: type: string const: function + title: Type default: function - description: Tool type identifier, always "function" name: type: string - description: Name of the function that can be called + title: Name description: - type: string - description: >- - (Optional) Description of what the function does + anyOf: + - type: string + - type: 'null' + title: Description 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 + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Parameters strict: - type: boolean - description: >- - (Optional) Whether to enforce strict parameter validation - additionalProperties: false + anyOf: + - type: boolean + - type: 'null' + title: Strict + type: object required: - - type - - name + - name + - parameters title: OpenAIResponseInputToolFunction - description: >- - Function tool configuration for OpenAI response inputs. + 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' 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 + 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 - description: Web search tool type variant to use search_context_size: - type: string + anyOf: + - type: string + pattern: ^low|medium|high$ + - type: 'null' + title: Search Context Size default: medium - description: >- - (Optional) Size of search context, must be "low", "medium", or "high" - additionalProperties: false - required: - - type + type: object title: OpenAIResponseInputToolWebSearch - description: >- - Web search tool configuration for OpenAI response inputs. + 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: - type: object 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 - additionalProperties: false + type: object required: - - arguments - - id - - name - - server_label - - type + - arguments + - id + - name + - server_label title: OpenAIResponseMCPApprovalRequest - description: >- - A request for human approval of a tool invocation. + description: A request for human approval of a tool invocation. OpenAIResponseMCPApprovalResponse: - type: object 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: - type: string + anyOf: + - type: string + - type: 'null' + title: Id reason: - type: string - additionalProperties: false + anyOf: + - type: string + - type: 'null' + title: Reason + type: object required: - - approval_request_id - - approve - - type + - approval_request_id + - approve title: OpenAIResponseMCPApprovalResponse description: A response to an MCP approval request. - OpenAIResponseMessage: - type: object + OpenAIResponseMessage-Input: properties: content: - oneOf: - - type: string - - type: array - items: - $ref: '#/components/schemas/OpenAIResponseInputMessageContent' - - type: array - items: - $ref: '#/components/schemas/OpenAIResponseOutputMessageContent' + 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: - oneOf: - - type: string - const: system - - type: string - const: developer - - type: string - const: user - - type: string - const: assistant + 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: - type: string + anyOf: + - type: string + - type: 'null' + title: Id status: - type: string - additionalProperties: false + anyOf: + - type: string + - type: 'null' + title: Status + type: object required: - - content - - role - - type + - 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. - OpenAIResponseObjectWithInput: + 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.' + 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. + + 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.' + OpenAIResponseObject: properties: created_at: type: integer - description: >- - Unix timestamp when the response was created + title: Created At error: - $ref: '#/components/schemas/OpenAIResponseError' - description: >- - (Optional) Error details if the response generation failed + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' id: type: string - description: Unique identifier for this response + title: Id model: type: string - description: Model identifier used for generation + title: Model object: type: string const: response + title: Object 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.) + 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 - description: >- - Whether tool calls can be executed in parallel previous_response_id: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + status: + type: string + title: Status + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + text: + $ref: '#/components/schemas/OpenAIResponseText' + default: + format: + type: text + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + 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 + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + 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' + OpenAIResponseObjectWithInput-Input: + properties: + created_at: + type: integer + title: Created At + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + id: + type: string + title: Id + model: type: string - description: >- - (Optional) ID of the previous response in a conversation + title: Model + object: + type: string + const: response + title: Object + 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 + parallel_tool_calls: + type: boolean + title: Parallel Tool Calls + default: false + previous_response_id: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id prompt: - $ref: '#/components/schemas/OpenAIResponsePrompt' - description: >- - (Optional) Reference to a prompt template and its variables. + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' status: type: string - description: >- - Current status of the response generation + title: Status temperature: - type: number - description: >- - (Optional) Sampling temperature used for generation + anyOf: + - type: number + - type: 'null' + title: Temperature text: $ref: '#/components/schemas/OpenAIResponseText' - description: >- - Text formatting configuration for the response + default: + format: + type: text top_p: - type: number - description: >- - (Optional) Nucleus sampling parameter used for generation + anyOf: + - type: number + - type: 'null' + title: Top P 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 + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + 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 + type: object + required: + - created_at + - id + - model + - output + - status + - input + title: OpenAIResponseObjectWithInput + description: 'OpenAI response object extended with input context information. + + + :param input: List of input items that led to this response' + OpenAIResponseObjectWithInput-Output: + properties: + created_at: + type: integer + title: Created At + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + id: + type: string + title: Id + model: + type: string + title: Model + object: + type: string + const: response + title: Object + default: response + output: items: - $ref: '#/components/schemas/OpenAIResponseTool' - description: >- - (Optional) An array of tools the model may call while generating a response. - truncation: + 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: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + status: type: string - description: >- - (Optional) Truncation strategy applied to the response + title: Status + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + text: + $ref: '#/components/schemas/OpenAIResponseText' + default: + format: + type: text + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + 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 + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation usage: - $ref: '#/components/schemas/OpenAIResponseUsage' - description: >- - (Optional) Token usage information for the response + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' instructions: - type: string - description: >- - (Optional) System message inserted into the model's context + anyOf: + - type: string + - type: 'null' + title: Instructions 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' - OpenAIResponseOutputMessageContent: - oneOf: - - $ref: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - - $ref: '#/components/schemas/OpenAIResponseContentPartRefusal' - discriminator: - propertyName: type - mapping: - output_text: '#/components/schemas/OpenAIResponseOutputMessageContentOutputText' - refusal: '#/components/schemas/OpenAIResponseContentPartRefusal' - "OpenAIResponseOutputMessageContentOutputText": + 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 type: object + required: + - created_at + - id + - model + - output + - status + - input + title: OpenAIResponseObjectWithInput + description: 'OpenAI response object extended with input context information. + + + :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: - type: array items: - $ref: '#/components/schemas/OpenAIResponseAnnotations' - additionalProperties: false - required: - - text - - type - - annotations - title: >- - OpenAIResponseOutputMessageContentOutputText - "OpenAIResponseOutputMessageFileSearchToolCall": + 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 - description: Unique identifier for this tool call + title: Id queries: - type: array items: type: string - description: List of search queries executed + type: array + title: Queries status: type: string - description: >- - Current status of the file search operation + title: Status type: type: string const: file_search_call + title: Type 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": + 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' + OpenAIResponseOutputMessageFunctionToolCall: properties: call_id: type: string - description: Unique identifier for the function call + title: Call Id name: type: string - description: Name of the function being called + title: Name arguments: type: string - description: >- - JSON string containing the function arguments + title: Arguments type: type: string const: function_call + title: Type default: function_call - description: >- - Tool call type identifier, always "function_call" id: - type: string - description: >- - (Optional) Additional identifier for the tool call + anyOf: + - type: string + - type: 'null' + title: Id status: - type: string - description: >- - (Optional) Current status of the function call execution - additionalProperties: false + anyOf: + - type: string + - type: 'null' + title: Status + type: object required: - - call_id - - name - - arguments - - type - title: >- - OpenAIResponseOutputMessageFunctionToolCall - description: >- - Function tool call output message for OpenAI responses. + - 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: - type: object properties: id: type: string - description: Unique identifier for this MCP call + title: Id type: type: string const: mcp_call + title: Type default: mcp_call - description: >- - Tool call type identifier, always "mcp_call" arguments: type: string - description: >- - JSON string containing the MCP call arguments + title: Arguments name: type: string - description: Name of the MCP method being called + title: Name server_label: type: string - description: >- - Label identifying the MCP server handling the call + title: Server Label error: - type: string - description: >- - (Optional) Error message if the MCP call failed + anyOf: + - type: string + - type: 'null' + title: Error output: - type: string - description: >- - (Optional) Output result from the successful MCP call - additionalProperties: false + anyOf: + - type: string + - type: 'null' + title: Output + type: object required: - - id - - type - - arguments - - name - - server_label + - id + - arguments + - name + - server_label title: OpenAIResponseOutputMessageMCPCall - description: >- - Model Context Protocol (MCP) call output message for OpenAI responses. + 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: - type: object properties: id: type: string - description: >- - Unique identifier for this MCP list tools operation + title: Id type: type: string const: mcp_list_tools + title: Type 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 + title: Server Label 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": + $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 - description: Unique identifier for this tool call + title: Id status: type: string - description: >- - Current status of the web search operation + title: Status type: type: string const: web_search_call + title: Type 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. - OpenAIResponsePrompt: 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 - description: Unique identifier of the prompt template + title: Id 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. + 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: - type: string - description: >- - Version number of the prompt to use (defaults to latest if not specified) - additionalProperties: false + anyOf: + - type: string + - type: 'null' + title: Version + type: object required: - - id + - id title: OpenAIResponsePrompt - description: >- - OpenAI compatible Prompt object that is used in OpenAI responses. + 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: - 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 + anyOf: + - $ref: '#/components/schemas/OpenAIResponseTextFormat' + - type: 'null' + type: object 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: + 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.' + OpenAIResponseToolMCP: properties: type: type: string const: mcp + title: Type default: mcp - description: Tool type identifier, always "mcp" server_label: type: string - description: Label to identify this MCP server + title: Server Label 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 + anyOf: + - items: + type: string + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + - type: 'null' + title: Allowed Tools + type: object + required: + - server_label title: OpenAIResponseToolMCP - description: >- - Model Context Protocol (MCP) tool configuration for OpenAI response object. + 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: - type: object properties: input_tokens: type: integer - description: Number of tokens in the input + title: Input Tokens output_tokens: type: integer - description: Number of tokens in the output + title: Output Tokens total_tokens: type: integer - description: Total tokens used (input + output) + title: Total Tokens 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 + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' + - type: 'null' 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 - 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 - 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: - 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 - 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: - - input - - model - title: CreateOpenaiResponseRequest - OpenAIResponseObject: - 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: - 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: - 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: - type: object - 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 - items: - $ref: '#/components/schemas/OpenAIResponseAnnotations' - description: >- - Structured annotations associated with the text - logprobs: - type: array - items: - 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: 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: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' + - type: 'null' type: object - 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": - type: object + - 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' + OpenAISystemMessageParam: 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: - 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: + role: 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: 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: - 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: + token: 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": + 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: - item_id: + role: 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: + const: tool + title: Role + default: tool + tool_call_id: 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": + 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: - 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: + token: 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: 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: - 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: - 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.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": + 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.' + OpenAIUserMessageParam-Output: 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: - 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: + role: 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": + 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.' + OptimizerConfig: properties: - delta: - type: string - item_id: - type: string - output_index: - type: integer - sequence_number: + optimizer_type: + $ref: '#/components/schemas/OptimizerType' + lr: + type: number + title: Lr + weight_decay: + type: number + title: Weight Decay + num_warmup_steps: type: integer - type: - type: string - const: response.mcp_call.arguments.delta - default: response.mcp_call.arguments.delta - additionalProperties: false + title: Num Warmup Steps + type: object required: - - delta - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta - "OpenAIResponseObjectStreamResponseMcpCallArgumentsDone": + - 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' + PaginatedResponse: + properties: + data: + items: + additionalProperties: true + type: object + type: array + title: Data + has_more: + type: boolean + title: Has More + url: + anyOf: + - type: string + - type: 'null' + title: Url type: object + required: + - data + - has_more + title: 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' + PostTrainingJobStatusResponse: properties: - arguments: - type: string - item_id: - type: string - output_index: - type: integer - sequence_number: - type: integer - type: + job_uuid: 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: 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. + + + :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' + PostTrainingMetric: properties: - sequence_number: + epoch: type: integer - description: >- - Sequential number for ordering streaming events - type: - 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: Epoch + train_loss: + type: number + title: Train Loss + validation_loss: + type: number + title: Validation Loss + perplexity: + type: number + title: Perplexity type: object + required: + - epoch + - train_loss + - validation_loss + - perplexity + title: 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' + Prompt: properties: - sequence_number: + prompt: + anyOf: + - type: string + - type: 'null' + title: Prompt + description: The system prompt with variable placeholders + version: type: integer - description: >- - Sequential number for ordering streaming events - type: + minimum: 1.0 + title: Version + description: Version (integer starting at 1, incremented on save) + prompt_id: 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: 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. + + + :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: - item_id: + api: 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: + title: Api + provider_id: 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 + 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: - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpCallInProgress - description: >- - Streaming event for MCP calls in progress. - "OpenAIResponseObjectStreamResponseMcpListToolsCompleted": + - 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' + 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' + RerankData: properties: - sequence_number: + index: type: integer - type: - type: string - const: response.mcp_list_tools.completed - default: response.mcp_list_tools.completed - additionalProperties: false + title: Index + relevance_score: + type: number + title: Relevance Score + type: object required: - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseMcpListToolsCompleted - "OpenAIResponseObjectStreamResponseMcpListToolsFailed": + - 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 - 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": - type: object + - data + title: RerankResponse + description: 'Response from a reranking request. + + + :param data: List of rerank result objects, sorted by relevance score (descending)' + SafetyViolation: 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": + violation_level: + $ref: '#/components/schemas/ViolationLevel' + user_message: + anyOf: + - type: string + - type: 'null' + title: User Message + 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: - response_id: - type: string - description: >- - Unique identifier of the response containing this output - item: + strategy: 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/GreedySamplingStrategy' + - $ref: '#/components/schemas/TopPSamplingStrategy' + - $ref: '#/components/schemas/TopKSamplingStrategy' + title: Strategy 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: + 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." + ScoringFn: + properties: + identifier: 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 + 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: 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: + 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/OpenAIResponseAnnotationFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationContainerFileCitation' - - $ref: '#/components/schemas/OpenAIResponseAnnotationFilePath' + - $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: - 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: - 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: - type: string - description: >- - Final complete text content of the output item - 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: + 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' + Session: + properties: + session_id: 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 - type: + title: Session Id + session_name: 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 - type: + title: Session Name + turns: + items: + $ref: '#/components/schemas/Turn' + type: array + title: Turns + started_at: 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": + format: date-time + title: Started At type: object + required: + - session_id + - session_name + - turns + - started_at + title: 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' + Shield: properties: - delta: + identifier: type: string - description: Incremental summary text being added - item_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: 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: Provider Id + description: ID of the provider that owns this resource 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: 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' + ShieldCallStep-Input: 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: + turn_id: 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: + title: Turn Id + step_id: type: string - description: Incremental reasoning text being added - item_id: + title: Step Id + 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 + step_type: 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: shield_call + title: Step Type + default: shield_call + violation: + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' + 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.' + ShieldCallStep-Output: + properties: + turn_id: 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 - text: + title: Turn Id + step_id: type: string - description: Final complete reasoning text - item_id: + title: Step Id + 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 + step_type: 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: + const: shield_call + title: Step Type + default: shield_call + violation: + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' + 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: 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: + 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. + + + :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." + 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: + 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: + toolgroup_id: + anyOf: + - type: string + - type: 'null' + title: Toolgroup Id + name: type: string - description: Incremental refusal text being added - item_id: + 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: + - 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' + ToolExecutionStep-Input: + properties: + turn_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: + title: Turn Id + step_id: 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: + title: Step Id + 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 + step_type: type: string - description: Final complete refusal text - item_id: + 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. + + + :param tool_calls: The tool calls to execute. + + :param tool_responses: The tool responses from the tool calls.' + ToolExecutionStep-Output: + properties: + turn_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: + title: Turn Id + step_id: 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 - type: + title: Step Id + 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 + step_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: 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.' + ToolGroup: properties: - item_id: + identifier: 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 + 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: 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 + 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: - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseWebSearchCallInProgress - description: >- - Streaming event for web search calls in progress. - "OpenAIResponseObjectStreamResponseWebSearchCallSearching": + - 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' + 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 + 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 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' + 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: - item_id: - type: string - output_index: - type: integer - sequence_number: - type: integer - type: + call_id: type: string - const: response.web_search_call.searching - default: response.web_search_call.searching - additionalProperties: false + 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: - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseWebSearchCallSearching - OpenAIDeleteResponseObject: + - 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: + - $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. + + + :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' + ToolResponseMessage-Input: properties: - id: + role: type: string - description: >- - Unique identifier of the deleted response - object: + const: tool + title: Role + default: tool + call_id: 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: + 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. + + + :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' + ToolResponseMessage-Output: properties: - data: - type: array - items: - $ref: '#/components/schemas/OpenAIResponseInput' - description: List of input items - object: + role: 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. - VectorStoreFileCounts: + 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: - 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 - description: >- - Number of files currently being processed - total: + type: + type: string + const: top_k + title: Type + default: top_k + top_k: type: integer - 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: + 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: - 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: 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: + const: top_p + title: Type + default: top_p + temperature: + anyOf: + - type: number + exclusiveMinimum: 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. + + + :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: - id: - type: string - description: Unique identifier for the vector store - object: - type: string - default: vector_store - description: >- - Object type identifier, always "vector_store" - created_at: - type: integer - description: >- - Timestamp when the vector store was created - name: - type: string - description: (Optional) Name of the vector store - usage_bytes: + n_epochs: 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: - 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: + title: N Epochs + max_steps_per_epoch: type: integer - description: >- - (Optional) Timestamp when the vector store will expire - last_active_at: + title: Max Steps Per Epoch + default: 1 + gradient_accumulation_steps: 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 - required: - - id - - object - - created_at - - usage_bytes - - file_counts - - status - - metadata - title: VectorStoreObject - description: OpenAI Vector Store object. - "OpenAICreateVectorStoreRequestWithExtraBody": + 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. + + + :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)' + Turn: properties: - name: + turn_id: type: string - description: (Optional) A name for the vector store - file_ids: + 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: - 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 + - $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: + anyOf: + - items: + $ref: '#/components/schemas/Attachment-Output' + type: array + - type: 'null' + title: Output Attachments + started_at: + type: string + format: date-time + title: Started At + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + 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' + URL: properties: - name: + uri: 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: + 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-Input: properties: - id: + role: type: string - description: >- - Unique identifier of the deleted vector store - object: + 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. + + + :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.' + UserMessage-Output: + properties: + role: 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 + 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: - - 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' + - 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.' VectorStoreChunkingStrategyAuto: - type: object properties: type: type: string const: auto + title: Type default: auto - description: >- - Strategy type, always "auto" for automatic chunking - additionalProperties: false - required: - - type + type: object title: VectorStoreChunkingStrategyAuto - description: >- - Automatic chunking strategy for vector store files. + description: 'Automatic chunking strategy for vector store files. + + + :param type: Strategy type, always "auto" for automatic chunking' VectorStoreChunkingStrategyStatic: - type: object properties: type: type: string const: static + title: Type 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 + type: object required: - - type - - static + - static title: VectorStoreChunkingStrategyStatic - description: >- - Static chunking strategy with configurable parameters. + 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: - type: object properties: chunk_overlap_tokens: type: integer + title: Chunk Overlap Tokens default: 400 - description: >- - Number of tokens to overlap between adjacent chunks max_chunk_size_tokens: type: integer + maximum: 4096.0 + minimum: 100.0 + title: Max Chunk Size Tokens 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 - required: - - file_ids - title: >- - OpenAICreateVectorStoreFileBatchRequestWithExtraBody - description: >- - Request to create a vector store file batch with extra_body support. - VectorStoreFileBatchObject: - type: object - properties: - 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" - created_at: - type: integer - description: >- - Timestamp when the file batch was created - 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 - file_counts: - $ref: '#/components/schemas/VectorStoreFileCounts' - description: >- - File processing status counts for the batch - additionalProperties: false - 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 - properties: - code: - oneOf: - - type: string - const: server_error - - type: string - const: rate_limit_exceeded - description: >- - Error code indicating the type of failure - message: - 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: - type: object - properties: - id: - type: string - description: Unique identifier for the file - object: - type: string - default: vector_store.file - description: >- - Object type identifier, always "vector_store.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 - 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 - 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 - 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 + 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' + VectorStoreContent: 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: type: string - description: >- - (Optional) ID of the first file in the list for pagination - last_id: + const: text + title: Type + text: 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: + title: Text 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 + - 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' + VectorStoreDeleteResponse: properties: id: type: string - description: Unique identifier of the deleted file + title: Id object: type: string - default: vector_store.file.deleted - description: >- - Object type identifier for the deletion response + title: Object + default: vector_store.deleted deleted: type: boolean + title: Deleted default: true - description: >- - Whether the deletion operation was successful - additionalProperties: false - required: - - id - - object - - deleted - title: VectorStoreFileDeleteResponse - description: >- - Response from deleting a vector store file. - VectorStoreContent: type: object + required: + - id + title: 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' + VectorStoreFileBatchObject: properties: - type: + id: type: string - const: text - description: >- - Content type, currently only "text" is supported - text: + title: Id + object: + type: string + title: Object + default: vector_store.file_batch + created_at: + type: integer + title: Created At + vector_store_id: type: string - description: The actual text content - additionalProperties: false + 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: - - type - - text - title: VectorStoreContent - description: >- - Content item from a vector store file or search result. + - 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' VectorStoreFileContentsResponse: - type: object properties: file_id: type: string - description: Unique identifier for the file + title: File Id filename: type: string - description: Name of the file + title: Filename attributes: + 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 + title: Attributes content: - type: array items: $ref: '#/components/schemas/VectorStoreContent' - description: List of content items from the file - additionalProperties: false + type: array + title: Content + type: object required: - - file_id - - filename - - attributes - - content + - file_id + - filename + - attributes + - content title: VectorStoreFileContentsResponse - description: >- - Response from retrieving the contents of a vector store file. - OpenaiSearchVectorStoreRequest: - 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' + VectorStoreFileCounts: 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: + completed: 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: string - description: >- - The search mode to use - "keyword", "vector", or "hybrid" (default "vector") - additionalProperties: false - required: - - query - title: OpenaiSearchVectorStoreRequest - VectorStoreSearchResponse: + 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' + VectorStoreFileDeleteResponse: properties: - file_id: - type: string - description: >- - Unique identifier of the file containing the result - filename: + id: 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 - required: - - file_id - - filename - - score - - content - title: VectorStoreSearchResponse - description: Response from searching a vector store. - VectorStoreSearchResponsePage: - type: object - properties: + title: Id object: type: string - default: vector_store.search_results.page - description: >- - Object type identifier for the search results page - 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 - has_more: + title: Object + default: vector_store.file.deleted + deleted: type: boolean - default: false - description: >- - Whether there are more results available beyond this page - next_page: - type: string - description: >- - (Optional) Token for retrieving the next page of results - additionalProperties: false - required: - - object - - search_query - - data - - has_more - title: VectorStoreSearchResponsePage - description: >- - Paginated response from searching a vector store. - 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: + title: Deleted + default: true type: object + required: + - id + title: 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' + VectorStoreFileLastError: properties: - job_uuid: + code: + anyOf: + - type: string + const: server_error + - type: string + const: rate_limit_exceeded + title: Code + message: 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: + title: Message 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 + - 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: - 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: + id: type: string - format: date-time - description: >- - (Optional) Timestamp when the job execution began - completed_at: + title: Id + object: type: string - format: date-time - description: >- - (Optional) Timestamp when the job finished, if completed - resources_allocated: + title: Object + default: vector_store.file + attributes: + additionalProperties: true 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: + 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 - 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: - 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: + - 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' + VectorStoreFilesListInBatchResponse: + properties: + object: 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: + 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 - 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 + required: + - data + title: 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' + VectorStoreListFilesResponse: 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: + 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 - description: >- - (Optional) Whether to use memory-efficient FSDP wrapping - fsdp_cpu_offload: + type: object + required: + - data + title: 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' + 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 - 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 + - data + title: 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' + VectorStoreObject: 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: + id: + type: string + title: Id + object: + type: string + title: Object + default: vector_store + created_at: type: integer - default: 1 - description: >- - Number of steps to accumulate gradients before updating - max_validation_steps: + title: Created At + name: + anyOf: + - type: string + - type: 'null' + title: Name + usage_bytes: 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: + title: Usage Bytes + default: 0 + file_counts: + $ref: '#/components/schemas/VectorStoreFileCounts' + status: 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: + 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. + + + :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' + VectorStoreSearchResponse: properties: - job_uuid: + file_id: 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 + title: File Id + filename: + type: string + title: Filename + score: + type: number + title: Score + attributes: + anyOf: + - additionalProperties: + anyOf: - 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: boolean + type: object + - type: 'null' + title: Attributes + content: + items: + $ref: '#/components/schemas/VectorStoreContent' + type: array + title: Content 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 + - 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: - type: + object: type: string - const: LoRA - default: LoRA - description: Algorithm type identifier, always "LoRA" - lora_attn_modules: - type: array + title: Object + default: vector_store.search_results.page + search_query: + type: string + title: Search Query + data: 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: + $ref: '#/components/schemas/VectorStoreSearchResponse' + type: array + title: Data + has_more: type: boolean + title: Has More 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: + next_page: + anyOf: + - type: string + - type: 'null' + title: Next Page 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 + - 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' + 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' + 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 + AgentTool: + oneOf: + - type: string + - type: object + properties: + name: + type: string + args: + type: object + required: + - name + - args + title: AgentToolGroupWithArgs responses: BadRequest400: description: The request was invalid or malformed @@ -10206,8 +9179,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: @@ -10215,11 +9187,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: @@ -10227,94 +9197,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. - - - ## Deprecated APIs - - - > **⚠️ DEPRECATED**: These APIs are provided for migration reference and will - be removed in future versions. Not recommended for new projects. - - - ### Migration Guidance - - - If you are using deprecated versions of the Agents or Responses APIs, please - migrate to: - - - - **Responses API**: Use the stable v1 Responses API endpoints - 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: 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: Models - description: '' - - name: PostTraining (Coming Soon) - description: '' - - name: Safety - description: OpenAI-compatible Moderations API. - x-displayName: Safety - - name: VectorIO - description: '' -x-tagGroups: - - name: Operations - tags: - - Agents - - Benchmarks - - DatasetIO - - Datasets - - Eval - - Files - - Inference - - Models - - PostTraining (Coming Soon) - - Safety - - VectorIO diff --git a/docs/static/experimental-llama-stack-spec.html b/docs/static/experimental-llama-stack-spec.html index 22473ec11e..b69d3ec479 100644 --- a/docs/static/experimental-llama-stack-spec.html +++ b/docs/static/experimental-llama-stack-spec.html @@ -1,5552 +1,16 @@ - - + Llama Stack API Documentation + - OpenAPI specification - - - - - - + + - diff --git a/docs/static/experimental-llama-stack-spec.yaml b/docs/static/experimental-llama-stack-spec.yaml index 0a52bc89b2..3b3eb3ca3b 100644 --- a/docs/static/experimental-llama-stack-spec.yaml +++ b/docs/static/experimental-llama-stack-spec.yaml @@ -1,55 +1,57 @@ 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' - tags: - - DatasetIO - summary: Append rows to a dataset. - description: Append rows to a dataset. - 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' - required: true - deprecated: false + description: Default Response /v1beta/datasetio/iterrows/{dataset_id}: get: + tags: + - V1Beta + summary: Iterrows + description: Response-only endpoint for proper schema generation. + operationId: iterrows_v1beta_datasetio_iterrows__dataset_id__get responses: '200': description: A PaginatedResponse. @@ -58,58 +60,24 @@ paths: schema: $ref: '#/components/schemas/PaginatedResponse' '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: - - 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 /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. @@ -118,22 +86,23 @@ 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. - parameters: [] - deprecated: false post: + tags: + - V1Beta + summary: Register Dataset + description: Response-only endpoint for proper schema generation. + operationId: register_dataset_v1beta_datasets_post responses: '200': description: A Dataset. @@ -142,86 +111,85 @@ 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: 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. - parameters: - - name: dataset_id - in: path - description: The ID of the dataset to get. - required: true - schema: - type: string - deprecated: false - delete: + - V1Beta + summary: Get Dataset + description: Response-only endpoint for proper schema generation. + operationId: get_dataset_v1beta_datasets__dataset_id__get 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: Response-only endpoint for proper schema generation. + operationId: list_agents_v1alpha_agents_get responses: '200': description: A PaginatedResponse. @@ -230,127 +198,116 @@ paths: schema: $ref: '#/components/schemas/PaginatedResponse' '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: 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 post: + tags: + - V1Alpha + summary: Create Agent + description: Typed endpoint for proper schema generation. + operationId: create_agent_v1alpha_agents_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AgentConfig-Input' + required: true 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': + 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/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. - parameters: - - name: agent_id - in: path - description: ID of the agent. - required: true - schema: - type: string - deprecated: false - delete: + - V1Alpha + summary: Get Agent + description: Response-only endpoint for proper schema generation. + operationId: get_agent_v1alpha_agents__agent_id__get 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: Response-only endpoint for proper schema generation. + operationId: create_agent_session_v1alpha_agents__agent_id__session_post responses: '200': description: An AgentSessionCreateResponse. @@ -359,168 +316,111 @@ paths: schema: $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' + /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. - 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: + - V1Alpha + summary: Get Agents Session + description: Response-only endpoint for proper schema generation. + operationId: get_agents_session_v1alpha_agents__agent_id__session__session_id__get 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: Response-only endpoint for proper schema generation. + operationId: 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': + 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: Create a new turn for an agent. - description: Create a new turn for an agent. - 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' - required: true - deprecated: false /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}: get: + tags: + - V1Alpha + summary: Get Agents Turn + description: Response-only endpoint for proper schema generation. + operationId: get_agents_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__get responses: '200': description: A Turn. @@ -529,102 +429,51 @@ paths: 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' - 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 /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/resume: post: + tags: + - V1Alpha + summary: Resume Agent Turn + description: Response-only endpoint for proper schema generation. + operationId: resume_agent_turn_v1alpha_agents__agent_id__session__session_id__turn__turn_id__resume_post 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': + 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: >- - 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. - 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' - required: true - deprecated: false /v1alpha/agents/{agent_id}/session/{session_id}/turn/{turn_id}/step/{step_id}: get: + tags: + - V1Alpha + summary: Get Agents Step + description: Response-only endpoint for proper schema generation. + operationId: get_agents_step_v1alpha_agents__agent_id__session__session_id__turn__turn_id__step__step_id__get responses: '200': description: An AgentStepResponse. @@ -633,48 +482,24 @@ paths: schema: $ref: '#/components/schemas/AgentStepResponse' '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 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 /v1alpha/agents/{agent_id}/sessions: get: + tags: + - V1Alpha + summary: List Agent Sessions + description: Response-only endpoint for proper schema generation. + operationId: list_agent_sessions_v1alpha_agents__agent_id__sessions_get responses: '200': description: A PaginatedResponse. @@ -683,42 +508,24 @@ paths: schema: $ref: '#/components/schemas/PaginatedResponse' '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: 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 /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 +535,244 @@ 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: - 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: - - Benchmarks - summary: Register a benchmark. - description: Register a benchmark. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterBenchmarkRequest' + - 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 - 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 + /v1alpha/eval/benchmarks/{benchmark_id}: + delete: tags: - - Benchmarks - summary: Get a benchmark by its ID. - description: Get a benchmark by its ID. + - 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: benchmark_id - in: path - description: The ID of the benchmark to get. - required: true - schema: - type: string - deprecated: false - delete: + - 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 + get: 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 - /v1alpha/eval/benchmarks/{benchmark_id}/evaluations: - post: + - V1Alpha + summary: Get Benchmark + description: Response-only endpoint for proper schema generation. + operationId: get_benchmark_v1alpha_eval_benchmarks__benchmark_id__get responses: '200': - description: >- - EvaluateResponse object containing generations and scores. + description: A Benchmark. content: application/json: schema: - $ref: '#/components/schemas/EvaluateResponse' + $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' + description: Default Response + /v1alpha/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. - parameters: - - name: benchmark_id - in: path - description: >- - The ID of the benchmark to run the evaluation on. - required: true - schema: - type: string + - 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/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: EvaluateResponse object containing generations and scores. content: application/json: schema: - $ref: '#/components/schemas/Job' + $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: Run an evaluation on a benchmark. - description: Run an evaluation 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/RunEvalRequest' + $ref: '#/components/schemas/BenchmarkConfig' required: true - deprecated: false - /v1alpha/eval/benchmarks/{benchmark_id}/jobs/{job_id}: - get: responses: '200': - description: The status of the evaluation job. + 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: Get the status of a job. - description: Get the status of a job. + - 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 - - 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: 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 + get: 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 + - V1Alpha + summary: Job Status + description: Response-only endpoint for proper schema generation. + operationId: job_status_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__get + 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: Job Result + description: Response-only endpoint for proper schema generation. + operationId: job_result_v1alpha_eval_benchmarks__benchmark_id__jobs__job_id__result_get responses: '200': description: The result of the job. @@ -984,70 +781,50 @@ paths: 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: 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 /v1alpha/inference/rerank: post: + tags: + - V1Alpha + summary: Rerank + description: Response-only endpoint for proper schema generation. + operationId: rerank_v1alpha_inference_rerank_post 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. - 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: Response-only endpoint for proper schema generation. + operationId: get_training_job_artifacts_v1alpha_post_training_job_artifacts_get responses: '200': description: A PostTrainingJobArtifactsResponse. @@ -1056,57 +833,60 @@ paths: schema: $ref: '#/components/schemas/PostTrainingJobArtifactsResponse' '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 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 /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: Response-only endpoint for proper schema generation. + operationId: get_training_job_status_v1alpha_post_training_job_status_get responses: '200': description: A PostTrainingJobStatusResponse. @@ -1115,30 +895,24 @@ paths: schema: $ref: '#/components/schemas/PostTrainingJobStatusResponse' '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 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 /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 +921,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 +953,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 +985,7151 @@ 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 + Agent: 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: + agent_id: type: string - description: >- - Error detail, a longer human-readable description of the error - instance: + title: Agent Id + agent_config: + $ref: '#/components/schemas/AgentConfig-Output' + created_at: 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: - 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: + format: date-time + title: Created At type: object - 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: - type: string - description: The URL for accessing this list - additionalProperties: false required: - - data - - has_more - title: PaginatedResponse - description: >- - A generic paginated response that follows a simple format. - Dataset: - type: object + - agent_id + - agent_config + - created_at + title: 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' + AgentConfig-Input: 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 - description: >- - Type of resource, always 'dataset' for datasets - purpose: - 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 + 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 - - 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: + - $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 - const: uri - default: uri - uri: + title: Model + instructions: 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: + 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: - 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 + - 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' + AgentConfig-Output: properties: sampling_params: - $ref: '#/components/schemas/SamplingParams' + anyOf: + - $ref: '#/components/schemas/SamplingParams' + - type: 'null' input_shields: - type: array - items: - type: string + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Input Shields output_shields: - type: array - items: - type: string + anyOf: + - items: + type: string + type: array + - type: 'null' + title: Output Shields toolgroups: - type: array - items: - $ref: '#/components/schemas/AgentTool' + anyOf: + - items: + anyOf: + - type: string + - $ref: '#/components/schemas/AgentToolGroupWithArgs' + type: array + - type: 'null' + title: Toolgroups client_tools: - type: array - items: - $ref: '#/components/schemas/ToolDef' + anyOf: + - items: + $ref: '#/components/schemas/ToolDef' + type: array + - type: 'null' + title: Client Tools 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. + anyOf: + - $ref: '#/components/schemas/ToolChoice' + - type: 'null' deprecated: true tool_prompt_format: - type: string - enum: - - json - - function_tag - - python_list - title: ToolPromptFormat - description: >- - Prompt format for calling custom / zero shot tools. + anyOf: + - $ref: '#/components/schemas/ToolPromptFormat' + - type: 'null' deprecated: true tool_config: - $ref: '#/components/schemas/ToolConfig' + anyOf: + - $ref: '#/components/schemas/ToolConfig' + - type: 'null' max_infer_iters: - type: integer + anyOf: + - type: integer + - type: 'null' + title: Max Infer Iters default: 10 model: type: string - description: >- - The model identifier to use for the agent + title: Model instructions: type: string - description: The system instructions for the agent + title: Instructions name: - type: string - description: >- - Optional name for the agent, used in telemetry and identification + anyOf: + - type: string + - type: 'null' + title: Name enable_session_persistence: - type: boolean + anyOf: + - type: boolean + - type: 'null' + title: Enable Session Persistence 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 + 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 required: - - model - - instructions + - 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: + 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' + AgentSessionCreateResponse: properties: - type: + session_id: 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: + title: Session Id 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 - 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 + - session_id + title: AgentSessionCreateResponse + description: 'Response returned when creating a new agent session. + + + :param session_id: Unique identifier for the created session' + AgentStepResponse: properties: - strategy: + step: oneOf: - - $ref: '#/components/schemas/GreedySamplingStrategy' - - $ref: '#/components/schemas/TopPSamplingStrategy' - - $ref: '#/components/schemas/TopKSamplingStrategy' + - $ref: '#/components/schemas/InferenceStep-Output' + - $ref: '#/components/schemas/ToolExecutionStep-Output' + - $ref: '#/components/schemas/ShieldCallStep-Output' + - $ref: '#/components/schemas/MemoryRetrievalStep-Output' + title: Step discriminator: - propertyName: type + propertyName: step_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: + 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. + + + :param step: The complete step data and execution details' + 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' + Batch: 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: + id: 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: + title: Id + completion_window: 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: + title: Completion Window + created_at: + type: integer + title: Created At + endpoint: type: string - description: >- - (Optional) ID of the tool group this tool belongs to - name: + title: Endpoint + input_file_id: type: string - description: Name of the tool - description: + title: Input File Id + object: 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) + 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: - 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 + 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: - - name - title: ToolDef - description: >- - Tool definition used in runtime contexts. - TopKSamplingStrategy: + - 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 + BatchUsage: properties: - type: - type: string - const: top_k - default: top_k - description: >- - Must be "top_k" to identify this sampling strategy - top_k: + input_tokens: 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: + 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: + 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: 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: + const: benchmark + title: Type + default: benchmark + dataset_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: + 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. + + + :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' + BuiltinTool: + type: string + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + Checkpoint: properties: - agent_id: + identifier: type: string - description: Unique identifier for the agent - agent_config: - $ref: '#/components/schemas/AgentConfig' - description: Configuration settings for the agent + title: Identifier 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: + title: Created At + epoch: + type: integer + title: Epoch + post_training_job_id: type: string - description: The name of the session to create. - additionalProperties: false + title: Post Training Job Id + path: + type: string + title: Path + training_metrics: + anyOf: + - $ref: '#/components/schemas/PostTrainingMetric' + - type: 'null' + type: object required: - - session_name - title: CreateAgentSessionRequest - AgentSessionCreateResponse: + - identifier + - created_at + - epoch + - post_training_job_id + - path + title: 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' + 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 + metadata: + additionalProperties: true + type: object + title: Metadata + 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: '#/components/schemas/ChunkMetadata' + - type: 'null' type: object + required: + - content + 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 embedding: Optional embedding for the chunk. If\ + \ not provided, it will be computed later.\n:param metadata: Metadata associated\ + \ with the chunk that will be used in the model context during inference.\n\ + :param stored_chunk_id: The chunk ID that is stored in the vector database.\ + \ Used for backend functionality.\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." + Chunk-Output: properties: - session_id: - type: string - description: >- - Unique identifier for the created session - additionalProperties: false + 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 + 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: '#/components/schemas/ChunkMetadata' + - type: 'null' + type: object required: - - session_id - title: AgentSessionCreateResponse - description: >- - Response returned when creating a new agent session. - CompletionMessage: + - content + 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 embedding: Optional embedding for the chunk. If\ + \ not provided, it will be computed later.\n:param metadata: Metadata associated\ + \ with the chunk that will be used in the model context during inference.\n\ + :param stored_chunk_id: The chunk ID that is stored in the vector database.\ + \ Used for backend functionality.\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: + 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.\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." + CompletionMessage-Input: properties: role: type: string const: assistant + title: Role 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 + 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: - 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. + $ref: '#/components/schemas/StopReason' tool_calls: - type: array - items: - $ref: '#/components/schemas/ToolCall' - description: >- - List of tool calls. Each tool call is a ToolCall object. - additionalProperties: false + anyOf: + - items: + $ref: '#/components/schemas/ToolCall' + type: array + - type: 'null' + title: Tool Calls + type: object required: - - role - - content - - stop_reason + - content + - stop_reason title: CompletionMessage - description: >- - A message containing the model's (assistant) response in a chat conversation. - ImageContentItem: - type: object + 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." + CompletionMessage-Output: properties: - type: + role: 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: + 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: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: - turn_id: - type: string - description: The ID of the turn. - step_id: + id: type: string - description: The ID of the step. - started_at: + title: Id + description: The unique ID of the conversation. + object: 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: + 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. + ConversationDeletedResource: properties: - turn_id: - type: string - description: The ID of the turn. - step_id: + id: type: string - description: The ID of the step. - started_at: - type: string - format: date-time - description: The time the step started. - completed_at: + title: Id + description: The deleted conversation identifier + object: type: string - format: date-time - description: The time the step completed. - step_type: + 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. + ConversationItemDeletedResource: + properties: + id: 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: + title: Id + description: The deleted item identifier + object: 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: + 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. + ConversationItemList: properties: - violation_level: - $ref: '#/components/schemas/ViolationLevel' - description: Severity level of the violation - user_message: + object: type: string - description: >- - (Optional) Message to convey to the user about the violation - metadata: - type: object - additionalProperties: + title: Object + description: Object type + default: list + data: + items: 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: + - $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. + DPOLossType: + type: string + enum: + - sigmoid + - hinge + - ipo + - kto_pair + title: DPOLossType + DataConfig: 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: + dataset_id: 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: + 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: - turn_id: - type: string - description: The ID of the turn. - step_id: - type: string - description: The ID of the step. - started_at: + identifier: type: string - format: date-time - description: The time the step started. - completed_at: + 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 - format: date-time - description: The time the step completed. - step_type: + title: Provider Id + description: ID of the provider that owns this resource + 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 + 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: - - turn_id - - step_id - - step_type - title: ShieldCallStep - description: A shield call step in an agent turn. - TextContentItem: + - 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 }" + 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' + GrammarResponseFormat: 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 + const: grammar + title: Type + default: grammar + bnf: + additionalProperties: true + type: object + title: Bnf + type: object required: - - type - - text - title: TextContentItem - description: A text content item - ToolCall: + - 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' + HealthStatus: + type: string + enum: + - OK + - Error + - Not Implemented + title: HealthStatus + InferenceStep-Input: properties: - call_id: + turn_id: type: string - tool_name: - oneOf: - - type: string - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - - type: string - arguments: + title: Turn Id + step_id: type: string - additionalProperties: false - required: - - call_id - - tool_name - - arguments - title: ToolCall - ToolExecutionStep: + title: Step Id + 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 + 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. + + + :param model_response: The response from the LLM.' + InferenceStep-Output: properties: turn_id: type: string - description: The ID of the turn. + title: Turn Id step_id: type: string - description: The ID of the step. + title: Step Id started_at: - type: string - format: date-time - description: The time the step started. + anyOf: + - type: string + format: date-time + - type: 'null' + title: Started At completed_at: - type: string - format: date-time - description: The time the step completed. + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At 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: + 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.' + 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: - call_id: + type: 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: + const: json_schema + title: Type + default: json_schema + json_schema: + additionalProperties: true 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: + title: Json Schema type: object + 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.' + LLMAsJudgeScoringFnParams: properties: - role: + type: 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: + const: llm_as_judge + title: Type + default: llm_as_judge + judge_model: type: string - description: >- - Unique identifier for the conversation session - input_messages: - type: array + title: Judge Model + prompt_template: + anyOf: + - type: string + - type: 'null' + title: Prompt Template + judge_score_regexes: items: - oneOf: - - $ref: '#/components/schemas/UserMessage' - - $ref: '#/components/schemas/ToolResponseMessage' - description: >- - List of messages that initiated this turn - steps: + type: string type: array + title: Judge Score Regexes + description: Regexes to extract the answer from generated response + aggregation_functions: 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 - output_message: - $ref: '#/components/schemas/CompletionMessage' - description: >- - The model's generated response containing content and metadata - output_attachments: + $ref: '#/components/schemas/AggregationFunctionType' 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: + title: Aggregation Functions + description: Aggregation functions to apply to the scores of each row 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: - type: object + - 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' + ListBatchesResponse: properties: - role: + object: 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 - 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 + const: list + title: Object + default: list + data: 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: + $ref: '#/components/schemas/Batch' 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: + 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 - 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: - type: object + - data + title: ListBatchesResponse + description: Response containing a list of batch objects. + ListOpenAIChatCompletionResponse: properties: - event_type: + data: + items: + $ref: '#/components/schemas/OpenAICompletionWithInputMessages' + type: array + title: Data + has_more: + type: boolean + title: Has More + first_id: 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: + title: First Id + last_id: type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - description: Type of step being executed - step_id: + title: Last Id + object: 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: + 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. + + + :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' + ListOpenAIFileResponse: properties: - event_type: + data: + items: + $ref: '#/components/schemas/OpenAIFileObject' + type: array + title: Data + has_more: + type: boolean + title: Has More + first_id: 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: First Id + last_id: type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - description: Type of step being executed - step_id: + title: Last Id + object: type: string - 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' - 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: + const: list + title: Object + default: list type: object + required: + - data + - has_more + - first_id + - last_id + title: 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"' + ListOpenAIResponseObject: properties: - event_type: + data: + items: + $ref: '#/components/schemas/OpenAIResponseObjectWithInput-Output' + type: array + title: Data + has_more: + type: boolean + title: Has More + first_id: 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: + title: First Id + last_id: type: string - enum: - - inference - - tool_execution - - shield_call - - memory_retrieval - description: Type of step being executed - step_id: + title: Last Id + object: type: string - description: >- - Unique identifier for the step within a turn - metadata: - 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: + const: list + title: Object + default: list 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 + - data + - has_more + - first_id + - last_id + title: 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"' + MemoryRetrievalStep-Input: properties: - event_type: + turn_id: 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: + title: Turn Id + step_id: 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: + title: Step Id + 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 + step_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: + const: memory_retrieval + title: Step Type + default: memory_retrieval + vector_store_ids: type: string - 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: + 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 - properties: - type: - type: string - const: image - 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: - type: object + - 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.' + MemoryRetrievalStep-Output: properties: - type: + turn_id: type: string - const: text - default: text - description: >- - Discriminator type of the delta. Always "text" - text: + title: Turn Id + step_id: 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: + title: Step Id + 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 + step_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: + const: memory_retrieval + title: Step Type + default: memory_retrieval + vector_store_ids: 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: + 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 - 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 - 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 + - 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.' + 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: 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 + 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: 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: + 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/Benchmark' - additionalProperties: false required: - - data - title: ListBenchmarksResponse - RegisterBenchmarkRequest: - 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' + ModelCandidate: 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: - 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 - properties: - type: - $ref: '#/components/schemas/ScoringFnParamsType' - const: basic - 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 - 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: - 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. - ModelCandidate: - type: object - properties: - type: + 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 - required: - - type - - model - - sampling_params - title: ModelCandidate - description: A model candidate for evaluation. - RegexParserScoringFnParams: + anyOf: + - $ref: '#/components/schemas/SystemMessage' + - type: 'null' 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. - 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: + required: + - 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.' + ModelType: type: string enum: - - llm_as_judge - - regex_parser - - basic - title: ScoringFnParamsType - description: >- - Types of scoring function parameter configurations. - SystemMessage: + - 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' + ModerationObjectResults: + properties: + flagged: + type: boolean + title: Flagged + 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 + 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.' + OpenAIAssistantMessageParam-Input: properties: role: type: string - const: system - default: system - description: >- - Must be "system" to identify this as a system message + const: assistant + title: Role + default: assistant 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: + 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: - 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: + 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. + + + :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: - generations: - type: array + id: + type: string + title: Id + choices: 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: - type: object - properties: - score_rows: + $ref: '#/components/schemas/OpenAIChoice-Output' 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. - 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: + title: Choices + object: type: string - description: Unique identifier for the job - status: + const: chat.completion + title: Object + default: chat.completion + created: + type: integer + title: Created + model: 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": + 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: type: type: string const: image_url + title: Type 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 + 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' + OpenAIChatCompletionContentPartTextParam: 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: + title: Text 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 + - 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: 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 + title: Model + messages: 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: + - $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. + + + :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: - 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: + 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: - data: - type: array - items: - $ref: '#/components/schemas/RerankData' - description: >- - List of rerank result objects, sorted by relevance score (descending) - additionalProperties: false + 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 + 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: - - data - title: RerankResponse - description: Response from a reranking request. - Checkpoint: + - 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' + 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. + + + :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' + OpenAIChoice-Output: properties: - identifier: - type: string - description: Unique identifier for the checkpoint - created_at: + 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. + + + :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-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. + + + :param content: (Optional) The log probabilities for the tokens in the message + + :param refusal: (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 - format: date-time - description: >- - Timestamp when the checkpoint was created - epoch: + title: Id + choices: + items: + $ref: '#/components/schemas/OpenAICompletionChoice-Output' + type: array + title: Choices + created: type: integer - description: >- - Training epoch when the checkpoint was saved - post_training_job_id: + title: Created + model: type: string - description: >- - Identifier of the training job that created this checkpoint - path: + title: Model + object: 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: + 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. + + + :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-Input: properties: - job_uuid: + finish_reason: 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: + 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. + + + :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' + OpenAICompletionChoice-Output: properties: - epoch: + finish_reason: + type: string + title: Finish Reason + text: + type: string + title: Text + index: 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: + 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: - job_uuid: + model: type: string - description: The UUID of the job to cancel. - additionalProperties: false - required: - - job_uuid - title: CancelTrainingJobRequest - PostTrainingJobStatusResponse: + 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.' + OpenAICompletionWithInputMessages: properties: - job_uuid: + id: 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: + title: Id + choices: + items: + $ref: '#/components/schemas/OpenAIChoice-Output' + type: array + title: Choices + object: type: string - format: date-time - description: >- - (Optional) Timestamp when the job execution began - completed_at: + const: chat.completion + title: Object + default: chat.completion + created: + type: integer + title: Created + model: type: string - format: date-time - description: >- - (Optional) Timestamp when the job finished, if completed - resources_allocated: - type: object - additionalProperties: + title: Model + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsage' + - type: 'null' + input_messages: + items: oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Information about computational resources allocated to the - job - checkpoints: + - $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 - 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: + title: Input Messages type: object + required: + - id + - choices + - created + - model + - input_messages + title: OpenAICompletionWithInputMessages + OpenAICreateVectorStoreFileBatchRequestWithExtraBody: properties: - data: - type: array + file_ids: items: + type: string + type: array + title: File Ids + attributes: + anyOf: + - additionalProperties: true type: object - properties: - job_uuid: - type: string - additionalProperties: false - required: - - job_uuid - title: PostTrainingJob - additionalProperties: false - required: - - data - title: ListPostTrainingJobsResponse - DPOAlignmentConfig: + - 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: - 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: + 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. + + + :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' + OpenAIDeleteResponseObject: properties: - dataset_id: + 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: + title: Id + object: 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: + const: response + title: Object + default: response + deleted: 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: + title: Deleted + default: true type: object + required: + - id + title: 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' + OpenAIDeveloperMessageParam: 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 + 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 + 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' + 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. + + + :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' + 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' + 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: + 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' + 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-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. + + 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.' + 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. + + 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.' + OpenAIResponseObject: + properties: + created_at: + type: integer + title: Created At + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + 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 - description: >- - (Optional) Whether to offload FSDP parameters to CPU - additionalProperties: false - title: EfficiencyConfig - description: >- - Configuration for memory and compute efficiency optimizations. + previous_response_id: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + status: + type: string + title: Status + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + text: + $ref: '#/components/schemas/OpenAIResponseText' + default: + format: + type: text + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + 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 + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + 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' + OpenAIResponseObjectWithInput-Input: + properties: + created_at: + type: integer + title: Created At + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + 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-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 + parallel_tool_calls: + type: boolean + title: Parallel Tool Calls + default: false + previous_response_id: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + status: + type: string + title: Status + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + text: + $ref: '#/components/schemas/OpenAIResponseText' + default: + format: + type: text + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + 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 + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + 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 + type: object + required: + - created_at + - id + - model + - output + - status + - input + title: OpenAIResponseObjectWithInput + description: 'OpenAI response object extended with input context information. + + + :param input: List of input items that led to this response' + OpenAIResponseObjectWithInput-Output: + properties: + created_at: + type: integer + title: Created At + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + 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: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + status: + type: string + title: Status + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + text: + $ref: '#/components/schemas/OpenAIResponseText' + default: + format: + type: text + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + 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 + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + 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 + type: object + required: + - created_at + - id + - model + - output + - status + - input + title: OpenAIResponseObjectWithInput + description: 'OpenAI response object extended with input context information. + + + :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 + 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' + 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.' + 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' + - type: 'null' + 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: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' + - type: 'null' + output_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' + - type: 'null' + 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' + 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: + 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. + + + :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: + 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. + + + :token: The token + + :bytes: (Optional) The bytes for the token + + :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. + + + :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.' 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' + PaginatedResponse: + properties: + data: + items: + additionalProperties: true + type: object + type: array + title: Data + has_more: + type: boolean + title: Has More + url: + anyOf: + - type: string + - type: 'null' + title: Url + type: object + required: + - data + - has_more + title: 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' + 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. + + + :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' + PostTrainingMetric: + properties: + epoch: + type: integer + title: Epoch + train_loss: + type: number + title: Train Loss + validation_loss: + type: number + title: Validation Loss + perplexity: + type: number + title: Perplexity + type: object + required: + - epoch + - train_loss + - validation_loss + - perplexity + title: 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' + Prompt: + properties: + 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 + 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: + 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. + + + :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' + 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' + 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. + + + :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)' + SafetyViolation: + properties: + violation_level: + $ref: '#/components/schemas/ViolationLevel' + user_message: + anyOf: + - type: string + - type: 'null' + title: User Message + 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: + 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." + 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. + + :param type: The resource type, always scoring_function' + Session: + properties: + session_id: + type: string + title: Session Id + session_name: + type: string + title: Session Name + turns: + items: + $ref: '#/components/schemas/Turn' + type: array + title: Turns + started_at: + type: string + format: date-time + title: Started At + type: object + required: + - session_id + - session_name + - turns + - started_at + title: 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' + 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 + 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' + ShieldCallStep-Input: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + 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 + step_type: + type: string + const: shield_call + title: Step Type + default: shield_call + violation: + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' + 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.' + ShieldCallStep-Output: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + 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 + step_type: + type: string + const: shield_call + title: Step Type + default: shield_call + violation: + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' + 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: + 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. + + + :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." + 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: + 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: + 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: + - 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' + ToolExecutionStep-Input: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + 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 + 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. + + + :param tool_calls: The tool calls to execute. + + :param tool_responses: The tool responses from the tool calls.' + ToolExecutionStep-Output: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + 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 + 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.' + 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 + 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: + - 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' + 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 + 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 + 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' + 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: + 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' + 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: + 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' + 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. + + + :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' + 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: + 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. + + + :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: + type: + type: string + const: top_p + title: Type + default: top_p + temperature: + anyOf: + - type: number + exclusiveMinimum: 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. + + + :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: + 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. + + + :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)' + 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: + anyOf: + - items: + $ref: '#/components/schemas/Attachment-Output' + type: array + - type: 'null' + title: Output Attachments + started_at: + type: string + format: date-time + title: Started At + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + 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' + 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' + 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. + + + :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.' + 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. + + + :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.' + VectorStoreChunkingStrategyAuto: + properties: + type: + type: string + 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: + 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. + + + :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' + 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' + 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. + + + :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' + 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. + + + :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' + 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 - 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 + - file_id + - filename + - attributes + - content + title: 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' + VectorStoreFileCounts: properties: - n_epochs: + completed: type: integer - description: Number of training epochs to run - max_steps_per_epoch: + title: Completed + cancelled: type: integer - default: 1 - description: Maximum number of steps to run per epoch - gradient_accumulation_steps: + title: Cancelled + failed: type: integer - default: 1 - description: >- - Number of steps to accumulate gradients before updating - max_validation_steps: + title: Failed + in_progress: 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: + 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' + VectorStoreFileDeleteResponse: + properties: + id: type: string - default: bf16 - description: >- - (Optional) Data type for model parameters (bf16, fp16, fp32) - additionalProperties: false + title: Id + object: + type: string + title: Object + default: vector_store.file.deleted + deleted: + type: boolean + title: Deleted + default: true + type: object required: - - n_epochs - - max_steps_per_epoch - - gradient_accumulation_steps - title: TrainingConfig - description: >- - Comprehensive configuration for the training process. - PreferenceOptimizeRequest: + - id + title: 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' + 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: - job_uuid: + id: 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: + title: Id + object: + type: string + title: Object + default: vector_store.file + attributes: + additionalProperties: true 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: 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. + + + :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' + VectorStoreFilesListInBatchResponse: properties: - job_uuid: + object: 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: + 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. + + + :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' + VectorStoreListFilesResponse: properties: - type: + object: type: string - const: LoRA - default: LoRA - description: Algorithm type identifier, always "LoRA" - lora_attn_modules: - type: array + title: Object + default: list + data: 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: + $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 - description: >- - (Optional) Whether to use DoRA (Weight-Decomposed Low-Rank Adaptation) - quantize_base: + type: object + required: + - data + title: 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' + 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 - 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 + required: + - data + title: 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' + VectorStoreObject: properties: - type: + id: type: string - const: QAT - default: QAT - description: Algorithm type identifier, always "QAT" - quantizer_name: + title: Id + object: type: string - description: >- - Name of the quantization algorithm to use - group_size: + title: Object + default: vector_store + created_at: 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: + 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. + + + :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' + VectorStoreSearchResponse: properties: - job_uuid: + file_id: 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 + title: File Id + filename: + type: string + title: Filename + score: + type: number + title: Score + attributes: + anyOf: + - additionalProperties: + anyOf: - 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: 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. + + + :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: + anyOf: + - type: string + - type: 'null' + title: Next Page + 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' + 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' + 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 - 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 + instance: + anyOf: + - type: string + - type: 'null' + default: null + title: Instance required: - - job_uuid - - training_config - - hyperparam_search_config - - logger_config - title: SupervisedFineTuneRequest + - status + - title + - detail + title: Error + type: object + AgentTool: + oneOf: + - type: string + - type: object + properties: + name: + type: string + args: + type: object + required: + - name + - args + title: AgentToolGroupWithArgs responses: BadRequest400: description: The request was invalid or malformed @@ -4028,8 +8142,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 +8150,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 +8160,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 index a481fe0746..9bbf7126e3 100644 --- a/docs/static/llama-stack-spec.html +++ b/docs/static/llama-stack-spec.html @@ -1,13393 +1,16 @@ - - + Llama Stack API Documentation + - OpenAPI specification - - - - - - + + - diff --git a/docs/static/llama-stack-spec.yaml b/docs/static/llama-stack-spec.yaml index ae582580b2..0316bca3c8 100644 --- a/docs/static/llama-stack-spec.yaml +++ b/docs/static/llama-stack-spec.yaml @@ -1,177 +1,239 @@ 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/chat/completions: + /v1/batches: get: + tags: + - V1 + summary: List Batches + description: Response-only endpoint for proper schema generation. + operationId: list_batches_v1_batches_get responses: '200': - description: A ListOpenAIChatCompletionResponse. + description: A list of batch objects. content: application/json: schema: - $ref: '#/components/schemas/ListOpenAIChatCompletionResponse' + $ref: '#/components/schemas/ListBatchesResponse' '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' + post: 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 + - V1 + summary: Create Batch + description: Response-only endpoint for proper schema generation. + operationId: create_batch_v1_batches_post + responses: + '200': + description: The created 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' + /v1/batches/{batch_id}: + get: + tags: + - V1 + summary: Retrieve Batch + description: Response-only endpoint for proper schema generation. + operationId: retrieve_batch_v1_batches__batch_id__get + responses: + '200': + description: The 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' + /v1/batches/{batch_id}/cancel: post: + tags: + - V1 + summary: Cancel Batch + description: Response-only endpoint for proper schema generation. + operationId: cancel_batch_v1_batches__batch_id__cancel_post responses: '200': - description: An OpenAIChatCompletion. + 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' + /v1/chat/completions: + get: + tags: + - V1 + summary: List Chat Completions + description: Response-only endpoint for proper schema generation. + operationId: list_chat_completions_v1_chat_completions_get + responses: + '200': + description: A ListOpenAIChatCompletionResponse. content: application/json: schema: - oneOf: - - $ref: '#/components/schemas/OpenAIChatCompletion' - - $ref: '#/components/schemas/OpenAIChatCompletionChunk' + $ref: '#/components/schemas/ListOpenAIChatCompletionResponse' '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' + post: 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: [] + - V1 + summary: Openai Chat Completion + description: Typed endpoint for proper schema generation. + operationId: openai_chat_completion_v1_chat_completions_post requestBody: content: application/json: schema: $ref: '#/components/schemas/OpenAIChatCompletionRequestWithExtraBody' required: true - deprecated: false - /v1/chat/completions/{completion_id}: - get: responses: '200': - description: A OpenAICompletionWithInputMessages. + description: An OpenAIChatCompletion. content: application/json: schema: - $ref: '#/components/schemas/OpenAICompletionWithInputMessages' + $ref: '#/components/schemas/OpenAIChatCompletion' '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/chat/completions/{completion_id}: + get: 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 - /v1/completions: - post: + - V1 + summary: Get Chat Completion + description: Response-only endpoint for proper schema generation. + operationId: get_chat_completion_v1_chat_completions__completion_id__get responses: '200': - description: An OpenAICompletion. + description: A OpenAICompletionWithInputMessages. content: application/json: schema: - $ref: '#/components/schemas/OpenAICompletion' + $ref: '#/components/schemas/OpenAICompletionWithInputMessages' '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/completions: + 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: 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 - deprecated: false + 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: Response-only endpoint for proper schema generation. + operationId: create_conversation_v1_conversations_post responses: '200': description: The created conversation object. @@ -180,138 +242,100 @@ paths: schema: $ref: '#/components/schemas/Conversation' '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: - - Conversations - summary: Create a conversation. - description: >- - Create a conversation. - - Create a conversation. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateConversationRequest' - required: true - deprecated: false /v1/conversations/{conversation_id}: - get: + delete: + tags: + - V1 + summary: Openai Delete Conversation + description: Response-only endpoint for proper schema generation. + operationId: openai_delete_conversation_v1_conversations__conversation_id__delete responses: '200': - description: The conversation object. + description: The deleted conversation resource. content: application/json: schema: - $ref: '#/components/schemas/Conversation' + $ref: '#/components/schemas/ConversationDeletedResource' '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' + get: tags: - - Conversations - summary: Retrieve a conversation. - description: >- - Retrieve a conversation. - - Get a conversation with the given ID. - parameters: - - name: conversation_id - in: path - description: The conversation identifier. - required: true - schema: - type: string - deprecated: false - post: + - V1 + summary: Get Conversation + description: Response-only endpoint for proper schema generation. + operationId: get_conversation_v1_conversations__conversation_id__get responses: '200': - description: The updated conversation object. + description: The conversation object. content: application/json: schema: $ref: '#/components/schemas/Conversation' '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' + post: tags: - - Conversations - summary: Update a conversation. - description: >- - Update a conversation. - - Update a conversation's metadata with the given ID. - parameters: - - name: conversation_id - in: path - description: The conversation identifier. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UpdateConversationRequest' - required: true - deprecated: false - delete: + - V1 + summary: Update Conversation + description: Response-only endpoint for proper schema generation. + operationId: update_conversation_v1_conversations__conversation_id__post 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': + 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: - - Conversations - summary: Delete a conversation. - description: >- - Delete a conversation. - - Delete a conversation with the given ID. - parameters: - - name: conversation_id - in: path - description: The conversation identifier. - required: true - schema: - type: string - deprecated: false /v1/conversations/{conversation_id}/items: get: + tags: + - V1 + summary: List Items + description: Response-only endpoint for proper schema generation. + operationId: list_items_v1_conversations__conversation_id__items_get responses: '200': description: List of conversation items. @@ -320,75 +344,23 @@ paths: schema: $ref: '#/components/schemas/ConversationItemList' '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: - - 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 post: + tags: + - V1 + summary: Add Items + description: Response-only endpoint for proper schema generation. + operationId: add_items_v1_conversations__conversation_id__items_post responses: '200': description: List of created items. @@ -397,431 +369,307 @@ paths: schema: $ref: '#/components/schemas/ConversationItemList' '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: - - Conversations - summary: Create items. - description: >- - Create items. - - Create items in the conversation. - parameters: - - name: conversation_id - in: path - description: The conversation identifier. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AddItemsRequest' - required: true - deprecated: false /v1/conversations/{conversation_id}/items/{item_id}: - get: + delete: + tags: + - V1 + summary: Openai Delete Conversation Item + description: Response-only endpoint for proper schema generation. + operationId: openai_delete_conversation_item_v1_conversations__conversation_id__items__item_id__delete responses: '200': - description: The conversation item. + description: The deleted item resource. content: application/json: schema: - $ref: '#/components/schemas/ConversationItem' + $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: Retrieve an item. - description: >- - Retrieve an item. - - Retrieve 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 - delete: + - name: args + in: query + required: true + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: The deleted item resource. + description: The conversation item. content: application/json: - schema: - $ref: '#/components/schemas/ConversationItemDeletedResource' + 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: - - Conversations - summary: Delete an item. - description: >- - Delete an item. - - Delete a conversation item. - 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 + 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. + description: An OpenAIEmbeddingsResponse containing the embeddings. content: application/json: schema: $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' - tags: - - Inference - summary: Create embeddings. - description: >- - Create embeddings. - - Generate OpenAI-compatible embeddings for the given input using the specified - model. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAIEmbeddingsRequestWithExtraBody' - required: true - deprecated: false /v1/files: get: + tags: + - V1 + summary: Openai List Files + description: Response-only endpoint for proper schema generation. + operationId: openai_list_files_v1_files_get responses: '200': - description: >- - An ListOpenAIFileResponse containing the list of files. + description: An ListOpenAIFileResponse containing the list of files. content: application/json: schema: $ref: '#/components/schemas/ListOpenAIFileResponse' '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: - - Files - summary: List files. - description: >- - List files. - - Returns a list of files that belong to the user's organization. - 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: + 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. + description: An OpenAIFileObject representing the uploaded file. content: application/json: schema: $ref: '#/components/schemas/OpenAIFileObject' '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: - - 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: + delete: + tags: + - V1 + summary: Openai Delete File + description: Response-only endpoint for proper schema generation. + operationId: openai_delete_file_v1_files__file_id__delete responses: '200': - description: >- - An OpenAIFileObject containing file information. + description: An OpenAIFileDeleteResponse indicating successful deletion. content: application/json: schema: - $ref: '#/components/schemas/OpenAIFileObject' + $ref: '#/components/schemas/OpenAIFileDeleteResponse' '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' + get: tags: - - Files - summary: Retrieve file. - description: >- - Retrieve file. - - Returns information about a specific file. - 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: + - V1 + summary: Openai Retrieve File + description: Response-only endpoint for proper schema generation. + operationId: openai_retrieve_file_v1_files__file_id__get responses: '200': - description: >- - An OpenAIFileDeleteResponse indicating successful deletion. + description: An OpenAIFileObject containing file information. content: application/json: schema: - $ref: '#/components/schemas/OpenAIFileDeleteResponse' + $ref: '#/components/schemas/OpenAIFileObject' '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: - - Files - summary: Delete file. - description: Delete file. - 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: + 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 responses: '200': - description: >- - The raw file content as a binary response. + description: The raw file content as a binary response. content: application/json: - schema: - $ref: '#/components/schemas/Response' + 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: - - Files - summary: Retrieve file content. - description: >- - Retrieve file content. - - Returns the contents of the specified file. - parameters: - - name: file_id - in: path - description: >- - The ID of the file to use for this request. - required: true - schema: - type: string - deprecated: false + 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 - summary: List routes. - description: >- - List routes. - - List all available API routes with their methods and implementing providers. - parameters: [] - 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 ListModelsResponse. @@ -830,22 +678,23 @@ paths: schema: $ref: '#/components/schemas/ListModelsResponse' '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: - - Models - summary: List all models. - description: List all models. - parameters: [] - deprecated: false post: + tags: + - V1 + summary: Register Model + description: Response-only endpoint for proper schema generation. + operationId: register_model_v1_models_post responses: '200': description: A Model. @@ -854,96 +703,85 @@ paths: schema: $ref: '#/components/schemas/Model' '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: - - Models - summary: Register model. - description: >- - Register model. - - Register a model. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RegisterModelRequest' - required: true - deprecated: false /v1/models/{model_id}: - get: + 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 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. - parameters: - - name: model_id - in: path - description: The identifier of the model to get. - required: true - schema: - type: string - deprecated: false - delete: + - V1 + summary: Get Model + description: Response-only endpoint for proper schema generation. + operationId: get_model_v1_models__model_id__get 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: Response-only endpoint for proper schema generation. + operationId: run_moderation_v1_moderations_post responses: '200': description: A moderation object. @@ -952,57 +790,49 @@ paths: schema: $ref: '#/components/schemas/ModerationObject' '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: - - 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 /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': + 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: - - Prompts - summary: List all prompts. - description: List all prompts. - parameters: [] - deprecated: false post: + tags: + - V1 + summary: Create Prompt + description: Response-only endpoint for proper schema generation. + operationId: create_prompt_v1_prompts_post responses: '200': description: The created Prompt resource. @@ -1011,283 +841,214 @@ paths: schema: $ref: '#/components/schemas/Prompt' '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/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. - 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: + - V1 + summary: Get Prompt + description: Response-only endpoint for proper schema generation. + operationId: get_prompt_v1_prompts__prompt_id__get 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). - 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' - required: true - deprecated: false - delete: + - V1 + summary: Update Prompt + description: Response-only endpoint for proper schema generation. + operationId: update_prompt_v1_prompts__prompt_id__post 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: Response-only endpoint for proper schema generation. + operationId: set_default_version_v1_prompts__prompt_id__set_default_version_post 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': + 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: - - Prompts - summary: Set prompt version. - description: >- - Set prompt version. - - Set which version of a prompt should be the default in get_prompt (latest). - 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' - required: true - deprecated: false /v1/prompts/{prompt_id}/versions: get: + tags: + - V1 + summary: List Prompt Versions + description: Response-only endpoint for proper schema generation. + operationId: list_prompt_versions_v1_prompts__prompt_id__versions_get 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': + 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: - - 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 /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: Response-only endpoint for proper schema generation. + operationId: inspect_provider_v1_providers__provider_id__get 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': + 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: 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 /v1/responses: get: + tags: + - V1 + summary: List Openai Responses + description: Response-only endpoint for proper schema generation. + operationId: list_openai_responses_v1_responses_get responses: '200': description: A ListOpenAIResponseObject. @@ -1296,47 +1057,23 @@ paths: schema: $ref: '#/components/schemas/ListOpenAIResponseObject' '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: List all responses. - description: List all responses. - 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: + tags: + - V1 + summary: Create Openai Response + description: Response-only endpoint for proper schema generation. + operationId: create_openai_response_v1_responses_post responses: '200': description: An OpenAIResponseObject. @@ -1344,107 +1081,76 @@ paths: application/json: schema: $ref: '#/components/schemas/OpenAIResponseObject' - text/event-stream: - schema: - $ref: '#/components/schemas/OpenAIResponseObjectStream' '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: Create a model response. - description: Create a model response. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CreateOpenaiResponseRequest' - 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: + delete: + tags: + - V1 + summary: Delete Openai Response + description: Response-only endpoint for proper schema generation. + operationId: delete_openai_response_v1_responses__response_id__delete responses: '200': - description: An OpenAIResponseObject. + description: An OpenAIDeleteResponseObject content: application/json: schema: - $ref: '#/components/schemas/OpenAIResponseObject' + $ref: '#/components/schemas/OpenAIDeleteResponseObject' '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' + get: tags: - - Agents - summary: Get a model response. - description: Get a model response. - parameters: - - name: response_id - in: path - description: >- - The ID of the OpenAI response to retrieve. - required: true - schema: - type: string - deprecated: false - delete: + - V1 + summary: Get Openai Response + description: Response-only endpoint for proper schema generation. + operationId: get_openai_response_v1_responses__response_id__get responses: '200': - description: An OpenAIDeleteResponseObject + description: An OpenAIResponseObject. content: application/json: schema: - $ref: '#/components/schemas/OpenAIDeleteResponseObject' + $ref: '#/components/schemas/OpenAIResponseObject' '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: 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 /v1/responses/{response_id}/input_items: get: + tags: + - V1 + summary: List Openai Response Input Items + description: Response-only endpoint for proper schema generation. + operationId: list_openai_response_input_items_v1_responses__response_id__input_items_get responses: '200': description: An ListOpenAIResponseInputItem. @@ -1453,68 +1159,24 @@ paths: schema: $ref: '#/components/schemas/ListOpenAIResponseInputItem' '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: 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 /v1/safety/run-shield: post: + tags: + - V1 + summary: Run Shield + description: Response-only endpoint for proper schema generation. + operationId: run_shield_v1_safety_run_shield_post responses: '200': description: A RunShieldResponse. @@ -1523,32 +1185,24 @@ paths: schema: $ref: '#/components/schemas/RunShieldResponse' '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: - - 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: + 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. @@ -1558,138 +1212,145 @@ 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. - parameters: - - name: scoring_fn_id - in: path - description: The ID of the scoring function to get. - required: true - schema: - type: string - deprecated: false - delete: + - V1 + summary: Get Scoring Function + description: Response-only endpoint for proper schema generation. + operationId: get_scoring_function_v1_scoring_functions__scoring_fn_id__get 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: Response-only endpoint for proper schema generation. + operationId: score_v1_scoring_score_post 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': + 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: - - 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 /v1/scoring/score-batch: post: + tags: + - V1 + summary: Score Batch + description: Response-only endpoint for proper schema generation. + operationId: score_batch_v1_scoring_score_batch_post responses: '200': description: A ScoreBatchResponse. @@ -1698,29 +1359,24 @@ paths: schema: $ref: '#/components/schemas/ScoreBatchResponse' '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: - - 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 /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. @@ -1729,22 +1385,23 @@ paths: schema: $ref: '#/components/schemas/ListShieldsResponse' '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: - - Shields - summary: List all shields. - description: List all shields. - parameters: [] - deprecated: false post: + tags: + - V1 + summary: Register Shield + description: Response-only endpoint for proper schema generation. + operationId: register_shield_v1_shields_post responses: '200': description: A Shield. @@ -1753,121 +1410,85 @@ paths: schema: $ref: '#/components/schemas/Shield' '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/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}: - get: + schema: + title: Args + - name: kwargs + in: query + required: true + schema: + title: Kwargs responses: '200': - description: A Shield. + description: Successful Response content: application/json: - schema: - $ref: '#/components/schemas/Shield' + 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: - - 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: + - V1 + summary: Get Shield + description: Response-only endpoint for proper schema generation. + operationId: get_shield_v1_shields__identifier__get responses: '200': - description: OK + description: A Shield. + content: + application/json: + schema: + $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: - - 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 - /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. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SyntheticDataGenerateRequest' - required: true - deprecated: false + description: Default Response /v1/tool-runtime/invoke: post: + tags: + - V1 + summary: Invoke Tool + description: Response-only endpoint for proper schema generation. + operationId: invoke_tool_v1_tool_runtime_invoke_post responses: '200': description: A ToolInvocationResult. @@ -1876,29 +1497,24 @@ paths: schema: $ref: '#/components/schemas/ToolInvocationResult' '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: - - ToolRuntime - summary: Run a tool with the given arguments. - description: Run a tool with the given arguments. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/InvokeToolRequest' - required: true - deprecated: false /v1/tool-runtime/list-tools: get: + tags: + - V1 + summary: List Runtime Tools + description: Response-only endpoint for proper schema generation. + operationId: list_runtime_tools_v1_tool_runtime_list_tools_get responses: '200': description: A ListToolDefsResponse. @@ -1907,100 +1523,86 @@ paths: schema: $ref: '#/components/schemas/ListToolDefsResponse' '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: - - 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 /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' - 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: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/InsertRequest' - required: true - deprecated: false + description: Default Response /v1/tool-runtime/rag-tool/query: post: + tags: + - V1 + summary: Rag Tool.Query + description: Response-only endpoint for proper schema generation. + operationId: rag_tool_query_v1_tool_runtime_rag_tool_query_post 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': + 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: - - 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 /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. @@ -2010,105 +1612,119 @@ 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' - tags: - - ToolGroups - summary: List tool groups with optional provider. - description: List tool groups with optional provider. - parameters: [] - deprecated: false + 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: 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. - parameters: - - name: toolgroup_id - in: path - description: The ID of the tool group to get. - required: true - schema: - type: string - deprecated: false - delete: + - V1 + summary: Get Tool Group + description: Response-only endpoint for proper schema generation. + operationId: get_tool_group_v1_toolgroups__toolgroup_id__get 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: Response-only endpoint for proper schema generation. + operationId: list_tools_v1_tools_get responses: '200': description: A ListToolDefsResponse. @@ -2117,30 +1733,24 @@ paths: schema: $ref: '#/components/schemas/ListToolDefsResponse' '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: - - 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 /v1/tools/{tool_name}: get: + tags: + - V1 + summary: Get Tool + description: Response-only endpoint for proper schema generation. + operationId: get_tool_v1_tools__tool_name__get responses: '200': description: A ToolDef. @@ -2149,56 +1759,60 @@ paths: schema: $ref: '#/components/schemas/ToolDef' '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: - - 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 /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: Response-only endpoint for proper schema generation. + operationId: query_chunks_v1_vector_io_query_post responses: '200': description: A QueryChunksResponse. @@ -2207,7815 +1821,7602 @@ paths: schema: $ref: '#/components/schemas/QueryChunksResponse' '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: - - VectorIO - summary: Query chunks from a vector database. - description: Query chunks from a vector database. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QueryChunksRequest' - required: true - deprecated: false /v1/vector_stores: get: + tags: + - V1 + summary: Openai List Vector Stores + description: Response-only endpoint for proper schema generation. + operationId: openai_list_vector_stores_v1_vector_stores_get responses: '200': - description: >- - A VectorStoreListResponse containing the list of vector stores. + description: A VectorStoreListResponse containing the list of vector stores. content: application/json: schema: $ref: '#/components/schemas/VectorStoreListResponse' '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: - - VectorIO - summary: Returns a list of vector stores. - description: Returns a 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 - 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: + tags: + - V1 + summary: Openai Create Vector Store + description: Typed endpoint for proper schema generation. + operationId: openai_create_vector_store_v1_vector_stores_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAICreateVectorStoreRequestWithExtraBody' + required: true responses: '200': - description: >- - A VectorStoreObject representing the created vector store. + description: A VectorStoreObject representing the created vector store. content: application/json: schema: $ref: '#/components/schemas/VectorStoreObject' '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: - - 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' - required: true - deprecated: false /v1/vector_stores/{vector_store_id}: - get: + delete: + tags: + - V1 + summary: Openai Delete Vector Store + description: Response-only endpoint for proper schema generation. + operationId: openai_delete_vector_store_v1_vector_stores__vector_store_id__delete responses: '200': - description: >- - A VectorStoreObject representing the vector store. + description: A VectorStoreDeleteResponse indicating the deletion status. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreObject' + $ref: '#/components/schemas/VectorStoreDeleteResponse' '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' + get: tags: - - VectorIO - summary: Retrieves a vector store. - description: Retrieves a vector store. - parameters: - - name: vector_store_id - in: path - description: The ID of the vector store to retrieve. - required: true - schema: - type: string - deprecated: false - post: + - V1 + summary: Openai Retrieve Vector Store + description: Response-only endpoint for proper schema generation. + operationId: openai_retrieve_vector_store_v1_vector_stores__vector_store_id__get responses: '200': - description: >- - A VectorStoreObject representing the updated vector store. + description: A VectorStoreObject representing the vector store. content: application/json: schema: $ref: '#/components/schemas/VectorStoreObject' '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' + 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 - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenaiUpdateVectorStoreRequest' - required: true - deprecated: false - delete: + - V1 + summary: Openai Update Vector Store + description: Response-only endpoint for proper schema generation. + operationId: openai_update_vector_store_v1_vector_stores__vector_store_id__post responses: '200': - description: >- - A VectorStoreDeleteResponse indicating the deletion status. + description: A VectorStoreObject representing the updated vector store. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreDeleteResponse' + $ref: '#/components/schemas/VectorStoreObject' '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: - - VectorIO - summary: Delete a vector store. - description: Delete a vector store. - 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: + 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. + 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': - $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: - - 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. - 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' - required: true - deprecated: false /v1/vector_stores/{vector_store_id}/file_batches/{batch_id}: get: + tags: + - V1 + summary: Openai Retrieve Vector Store File Batch + description: Response-only endpoint for proper schema generation. + operationId: openai_retrieve_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__get responses: '200': - description: >- - A VectorStoreFileBatchObject representing the file batch. + description: A VectorStoreFileBatchObject representing the file batch. content: application/json: schema: $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' - tags: - - VectorIO - summary: Retrieve a vector store file batch. - description: Retrieve a vector store 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 - 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: + tags: + - V1 + summary: Openai Cancel Vector Store File Batch + description: Response-only endpoint for proper schema generation. + operationId: openai_cancel_vector_store_file_batch_v1_vector_stores__vector_store_id__file_batches__batch_id__cancel_post responses: '200': - description: >- - A VectorStoreFileBatchObject representing the cancelled file batch. + 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': - $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: - - VectorIO - summary: Cancels a vector store file batch. - description: Cancels a vector store 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 - 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: + tags: + - V1 + summary: Openai List Files In Vector Store File Batch + description: Response-only 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 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: $ref: '#/components/schemas/VectorStoreFilesListInBatchResponse' '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: - - VectorIO - summary: >- - Returns a list of vector store files in a batch. - description: >- - Returns a list of vector store files in a 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 - 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: + tags: + - V1 + summary: Openai List Files In Vector Store + description: Response-only endpoint for proper schema generation. + operationId: openai_list_files_in_vector_store_v1_vector_stores__vector_store_id__files_get responses: '200': - description: >- - A VectorStoreListFilesResponse containing the list of files. + description: A VectorStoreListFilesResponse containing the list of files. content: application/json: schema: $ref: '#/components/schemas/VectorStoreListFilesResponse' '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: - - VectorIO - summary: List files in a vector store. - description: List files in a vector store. - 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: + tags: + - V1 + summary: Openai Attach File To Vector Store + description: Response-only endpoint for proper schema generation. + operationId: openai_attach_file_to_vector_store_v1_vector_stores__vector_store_id__files_post responses: '200': - description: >- - A VectorStoreFileObject representing the attached file. + description: A VectorStoreFileObject representing the attached file. content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileObject' '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: - - VectorIO - summary: Attach a file to a vector store. - description: Attach a file to a vector store. - 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' - required: true - deprecated: false /v1/vector_stores/{vector_store_id}/files/{file_id}: - get: + delete: + tags: + - V1 + summary: Openai Delete Vector Store File + description: Response-only endpoint for proper schema generation. + operationId: openai_delete_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__delete responses: '200': - description: >- - A VectorStoreFileObject representing the file. + description: A VectorStoreFileDeleteResponse indicating the deletion status. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFileObject' + $ref: '#/components/schemas/VectorStoreFileDeleteResponse' '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' + get: tags: - - VectorIO - summary: Retrieves a vector store file. - description: Retrieves 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 - post: + - V1 + summary: Openai Retrieve Vector Store File + description: Response-only endpoint for proper schema generation. + operationId: openai_retrieve_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__get responses: '200': - description: >- - A VectorStoreFileObject representing the updated file. + description: A VectorStoreFileObject representing the file. content: application/json: schema: $ref: '#/components/schemas/VectorStoreFileObject' '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' + post: tags: - - VectorIO - summary: Updates a vector store file. - description: Updates a vector store 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 - description: The ID of the file to update. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OpenaiUpdateVectorStoreFileRequest' - required: true - deprecated: false - delete: + - V1 + summary: Openai Update Vector Store File + description: Response-only endpoint for proper schema generation. + operationId: openai_update_vector_store_file_v1_vector_stores__vector_store_id__files__file_id__post responses: '200': - description: >- - A VectorStoreFileDeleteResponse indicating the deletion status. + description: A VectorStoreFileObject representing the updated file. content: application/json: schema: - $ref: '#/components/schemas/VectorStoreFileDeleteResponse' + $ref: '#/components/schemas/VectorStoreFileObject' '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: - - 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: + tags: + - V1 + summary: Openai Retrieve Vector Store File Contents + description: Response-only endpoint for proper schema generation. + operationId: openai_retrieve_vector_store_file_contents_v1_vector_stores__vector_store_id__files__file_id__content_get 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': + 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: - - 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 /v1/vector_stores/{vector_store_id}/search: post: + tags: + - V1 + summary: Openai Search Vector Store + description: Response-only endpoint for proper schema generation. + operationId: openai_search_vector_store_v1_vector_stores__vector_store_id__search_post 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': + 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: - - 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 /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: - type: object + Agent: 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: + agent_id: type: string - description: >- - Error detail, a longer human-readable description of the error - instance: + title: Agent Id + agent_config: + $ref: '#/components/schemas/AgentConfig-Output' + created_at: 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. - Order: - type: string - enum: - - asc - - desc - title: Order - description: Sort order for paginated responses. - ListOpenAIChatCompletionResponse: + format: date-time + title: Created At 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: + required: + - agent_id + - agent_config + - created_at + title: 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' + 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: ID of the first completion in this list - last_id: + title: Model + instructions: type: string - description: ID of the last completion in this list - object: + 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 + required: + - 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' + 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 - 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: - type: object - properties: - role: + title: Model + instructions: 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 + title: Instructions 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": - type: object + 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 + required: + - 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: - type: + agent_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: 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' + AgentSessionCreateResponse: properties: - type: - type: string - const: text - default: text - description: >- - Must be "text" to identify this as text content - text: + session_id: type: string - description: The text content of the message - additionalProperties: false + title: Session Id + type: object required: - - type - - text - title: OpenAIChatCompletionContentPartTextParam - description: >- - Text content part for OpenAI-compatible chat completion messages. - OpenAIChatCompletionToolCall: + - session_id + title: AgentSessionCreateResponse + description: 'Response returned when creating a new agent session. + + + :param session_id: Unique identifier for the created 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 + 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. + + + :param step: The complete step data and execution details' + 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' + Batch: 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: + title: Id + completion_window: 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: - type: object - properties: - name: + title: Completion Window + created_at: + type: integer + title: Created At + endpoint: type: string - description: (Optional) Name of the function to call - arguments: + title: Endpoint + input_file_id: 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 + 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: - prompt_tokens: + 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 + BatchUsage: + properties: + input_tokens: type: integer - description: Number of tokens in the prompt - completion_tokens: + title: Input Tokens + input_tokens_details: + $ref: '#/components/schemas/InputTokensDetails' + output_tokens: type: integer - description: Number of tokens in the completion + title: Output Tokens + output_tokens_details: + $ref: '#/components/schemas/OutputTokensDetails' 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: + title: Total Tokens + additionalProperties: true type: object + required: + - input_tokens + - input_tokens_details + - output_tokens + - output_tokens_details + - total_tokens + title: BatchUsage + Benchmark: 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: + identifier: 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 + 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: benchmark + title: Type + default: benchmark + dataset_id: + type: string + title: Dataset Id + scoring_functions: 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: Scoring Functions + metadata: + additionalProperties: true + type: object + title: Metadata + description: Metadata for this evaluation task 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 + - 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' + BuiltinTool: + type: string + enum: + - brave_search + - wolfram_alpha + - photogen + - code_interpreter + title: BuiltinTool + Checkpoint: properties: - type: + identifier: type: string - const: file - default: file - file: - $ref: '#/components/schemas/OpenAIFileFile' - additionalProperties: false - required: - - type - - file - title: OpenAIFile - OpenAIFileFile: - type: object - properties: - file_data: + title: Identifier + created_at: type: string - file_id: + format: date-time + title: Created At + epoch: + type: integer + title: Epoch + post_training_job_id: type: string - filename: + title: Post Training Job Id + path: type: string - additionalProperties: false - title: OpenAIFileFile - OpenAIImageURL: + title: Path + training_metrics: + anyOf: + - $ref: '#/components/schemas/PostTrainingMetric' + - type: 'null' 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 + - identifier + - created_at + - epoch + - post_training_job_id + - path + title: 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' + 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: + 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: + additionalProperties: true + type: object + title: Metadata + 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: '#/components/schemas/ChunkMetadata' + - type: 'null' type: object + required: + - content + 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 embedding: Optional embedding for the chunk. If\ + \ not provided, it will be computed later.\n:param metadata: Metadata associated\ + \ with the chunk that will be used in the model context during inference.\n\ + :param stored_chunk_id: The chunk ID that is stored in the vector database.\ + \ Used for backend functionality.\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." + Chunk-Output: properties: - token: - type: string - bytes: - type: array - items: - type: integer - logprob: - type: number - top_logprobs: - type: array - items: - $ref: '#/components/schemas/OpenAITopLogProb' - additionalProperties: false + 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 + 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: '#/components/schemas/ChunkMetadata' + - type: 'null' + type: object required: - - token - - logprob - - top_logprobs - title: OpenAITokenLogProb - description: >- - The log probability for a token from an OpenAI-compatible chat completion - response. - OpenAIToolMessageParam: + - content + 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 embedding: Optional embedding for the chunk. If\ + \ not provided, it will be computed later.\n:param metadata: Metadata associated\ + \ with the chunk that will be used in the model context during inference.\n\ + :param stored_chunk_id: The chunk ID that is stored in the vector database.\ + \ Used for backend functionality.\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: + 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.\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." + CompletionMessage-Input: properties: role: type: string - const: tool - default: tool - description: >- - Must be "tool" to identify this as a tool response - tool_call_id: - type: string - description: >- - Unique identifier for the tool call this response is for + const: assistant + title: Role + default: assistant 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: + 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 - 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 + - 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." + CompletionMessage-Output: properties: role: type: string - const: user - default: user - description: >- - Must be "user" to identify this as a user message + const: assistant + title: Role + default: assistant 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: + 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: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: - name: + id: type: string - description: Name of the schema - description: + title: Id + description: The unique ID of the conversation. + object: 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: + 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 - 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 + - id + - created_at + title: Conversation + description: OpenAI-compatible conversation object. + ConversationDeletedResource: properties: - type: + id: 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: + 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. + ConversationItemDeletedResource: properties: - type: + id: type: string - const: text - default: text - 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: + 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. + ConversationItemList: properties: - model: + object: 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 + title: Object + description: Object type + default: list + data: 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: + 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 - 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: + 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 - 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: + 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. + DPOLossType: + type: string + enum: + - sigmoid + - hinge + - ipo + - kto_pair + title: DPOLossType + DataConfig: + properties: + dataset_id: + type: string + title: Dataset Id + batch_size: type: integer - description: >- - (Optional) The number of completions to generate. - parallel_tool_calls: + title: Batch Size + shuffle: 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: + 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: + 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 + default: dataset + purpose: + $ref: '#/components/schemas/DatasetPurpose' + source: 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: + - $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 - 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: - - 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 + title: Metadata + description: Any additional metadata for this dataset + type: object required: - - model - - messages - title: OpenAIChatCompletionRequestWithExtraBody - description: >- - Request parameters for OpenAI-compatible chat completion endpoint. - OpenAIChatCompletion: + - 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 }" + 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' + GrammarResponseFormat: properties: - id: + type: type: string - description: The ID of the chat completion - choices: - type: array - items: - $ref: '#/components/schemas/OpenAIChoice' - description: List of choices - object: + 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. + + + :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: 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: + 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' + HealthStatus: + type: string + enum: + - OK + - Error + - Not Implemented + title: HealthStatus + InferenceStep-Input: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + 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 + 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. + + + :param model_response: The response from the LLM.' + InferenceStep-Output: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + 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 + 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.' + 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 - 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: + 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. + + + :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: - id: + type: type: string - description: The ID of the chat completion - choices: + 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/OpenAIChunkChoice' - description: List of choices + $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' + ListBatchesResponse: + properties: 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: + const: list + title: Object + 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. + ListOpenAIChatCompletionResponse: properties: - content: - type: string - description: (Optional) The content of the delta - refusal: + data: + items: + $ref: '#/components/schemas/OpenAICompletionWithInputMessages' + type: array + title: Data + has_more: + type: boolean + title: Has More + first_id: type: string - description: (Optional) The refusal of the delta - role: + title: First Id + last_id: 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: + title: Last Id + object: 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: + 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. + + + :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' + ListOpenAIFileResponse: properties: - id: - type: string - description: The ID of the chat completion - choices: - type: array + data: items: - $ref: '#/components/schemas/OpenAIChoice' - description: List of choices - object: + $ref: '#/components/schemas/OpenAIFileObject' + type: array + title: Data + has_more: + type: boolean + title: Has More + first_id: 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: First Id + last_id: 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: + title: Last Id + object: + type: string + const: list + title: Object + default: list type: object + required: + - data + - has_more + - first_id + - last_id + title: 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"' + ListOpenAIResponseObject: 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: + data: + items: + $ref: '#/components/schemas/OpenAIResponseObjectWithInput-Output' + type: array + title: Data + has_more: 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: + title: Has More + first_id: type: string - choices: - type: array - items: - $ref: '#/components/schemas/OpenAICompletionChoice' - created: - type: integer - model: + title: First Id + last_id: type: string + title: Last Id 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: + const: list + title: Object + default: list type: object - properties: - finish_reason: - type: string - text: + required: + - data + - has_more + - first_id + - last_id + title: 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"' + MemoryRetrievalStep-Input: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + 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 + step_type: + type: string + const: memory_retrieval + title: Step Type + default: memory_retrieval + vector_store_ids: type: string - index: - type: integer - logprobs: - $ref: '#/components/schemas/OpenAIChoiceLogprobs' - additionalProperties: false + 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: - - 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: + - 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.' + MemoryRetrievalStep-Output: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + 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 + 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.' + Model: properties: - type: + identifier: 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: + 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: Title of the referenced web resource - url: + title: Provider Id + description: ID of the provider that owns this resource + type: 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": + 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. + + + :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' + ModelCandidate: 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: + const: model + title: Type + default: model + model: type: string - start_index: - type: integer - additionalProperties: false - required: - - type - - container_id - - end_index - - file_id - - filename - - start_index - title: >- - OpenAIResponseAnnotationContainerFileCitation - OpenAIResponseAnnotationFileCitation: + title: Model + sampling_params: + $ref: '#/components/schemas/SamplingParams' + system_message: + anyOf: + - $ref: '#/components/schemas/SystemMessage' + - type: 'null' type: object + required: + - 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.' + 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' + ModerationObjectResults: 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: + flagged: + type: boolean + title: Flagged + 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 + 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.' + OpenAIAssistantMessageParam-Input: properties: - type: - type: string - const: file_path - default: file_path - file_id: + role: 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: 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: - type: - type: string - const: refusal - default: refusal - description: >- - Content part type identifier, always "refusal" - refusal: + role: 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": + 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: - 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: + title: Id + choices: + items: + $ref: '#/components/schemas/OpenAIChoice-Output' + type: array + title: Choices + object: type: string - description: >- - The URL of the file to be sent to the model. - filename: + const: chat.completion + title: Object + default: chat.completion + created: + type: integer + title: Created + model: 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: + title: Model + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIChatCompletionUsage' + - type: 'null' 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 + - 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: - 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: + const: image_url + title: Type + default: image_url + image_url: + $ref: '#/components/schemas/OpenAIImageURL' 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 + - 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: - approval_request_id: - type: string - approve: - type: boolean type: type: string - const: mcp_approval_response - default: mcp_approval_response - id: - type: string - reason: + const: text + title: Type + default: text + text: type: string - additionalProperties: false - required: - - approval_request_id - - approve - - type - title: OpenAIResponseMCPApprovalResponse - description: A response to an MCP approval request. - OpenAIResponseMessage: + title: Text 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 + - 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: - text: - type: string - type: + model: type: string - const: output_text - default: output_text - annotations: - type: array + title: Model + messages: items: - $ref: '#/components/schemas/OpenAIResponseAnnotations' - additionalProperties: false - required: - - text - - type - - annotations - title: >- - OpenAIResponseOutputMessageContentOutputText - "OpenAIResponseOutputMessageFileSearchToolCall": + 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. + + + :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: - 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 + anyOf: + - type: string + - type: 'null' + title: Id 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": + 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: - call_id: - type: string - description: Unique identifier for the function call name: - type: string - description: Name of the function being called + anyOf: + - type: string + - type: 'null' + title: Name 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: + 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: - 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: + 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. + + + :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' + OpenAIChoice-Input: 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: + 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 - 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": + title: Finish Reason + index: + type: integer + title: Index + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Input' + - type: 'null' 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 - 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 + - 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' + OpenAIChoice-Output: properties: - id: - type: string - 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 - const: conversation - default: conversation - created_at: + title: Finish Reason + index: type: integer - metadata: - type: object - additionalProperties: - type: string - 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 - required: - - id - - object - - created_at - title: Conversation - description: OpenAI-compatible conversation object. - UpdateConversationRequest: + title: Index + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' + - type: 'null' 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: + - 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-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. + + + :param content: (Optional) The log probabilities for the tokens in the message + + :param refusal: (Optional) The log probabilities for the tokens in the message' + OpenAIChoiceLogprobs-Output: 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: + 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: - object: + id: type: string - default: list - data: - type: array + title: Id + choices: 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: + $ref: '#/components/schemas/OpenAICompletionChoice-Output' type: array - items: - $ref: '#/components/schemas/ConversationItem' - description: >- - Items to include in the conversation context. - additionalProperties: false - required: - - items - title: AddItemsRequest - ConversationItemDeletedResource: - type: object - properties: - id: + title: Choices + created: + type: integer + title: Created + model: type: string + title: Model 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: + 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. + + + :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-Input: properties: - model: + finish_reason: 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: + title: Finish Reason + text: type: string - default: float - description: >- - (Optional) The format to return the embeddings in. Can be either "float" - or "base64". Defaults to "float". - dimensions: + title: Text + index: 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: + 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. + + + :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' + OpenAICompletionChoice-Output: properties: - object: + finish_reason: 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") + title: Finish Reason + text: + type: string + title: Text 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: + title: Index + logprobs: + anyOf: + - $ref: '#/components/schemas/OpenAIChoiceLogprobs-Output' + - type: 'null' 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 + - 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: - 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: + 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 - properties: - anchor: - type: string - const: created_at - seconds: - type: integer - additionalProperties: false required: - - anchor - - seconds - title: ExpiresAfter - description: >- - Control expiration of uploaded files. + - model + - prompt + title: OpenAICompletionRequestWithExtraBody + description: 'Request parameters for OpenAI-compatible completion endpoint. - Params: - - anchor, must be "created_at" - - seconds, must be int between 3600 and 2592000 (1 hour to 30 days) - OpenAIFileDeleteResponse: - type: object + + :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.' + OpenAICompletionWithInputMessages: properties: id: type: string - description: The file identifier that was deleted + title: Id + choices: + items: + $ref: '#/components/schemas/OpenAIChoice-Output' + type: array + title: Choices 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: + const: chat.completion + title: Object + default: chat.completion + created: + type: integer + title: Created + model: 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: + 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: - route: - type: string - description: The API endpoint path - method: - type: string - description: HTTP method for the route - provider_types: - type: array + file_ids: 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. - Model: - type: object + 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: - 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 + 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: - 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. - ModelType: - type: string - enum: - - llm - - embedding - - rerank - title: ModelType - description: >- - Enumeration of supported model types in Llama Stack. - ListModelsResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/Model' - additionalProperties: false - required: - - data - title: ListModelsResponse - RegisterModelRequest: + 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' + OpenAIDeleteResponseObject: properties: - model_id: - type: string - description: The identifier of the model to register. - provider_model_id: + id: type: string - description: >- - The identifier of the model in the provider. - provider_id: + title: Id + object: 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 - RunModerationRequest: + const: response + title: Object + default: response + deleted: + type: boolean + title: Deleted + default: true 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 - ModerationObject: - type: object + - id + title: 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' + OpenAIDeveloperMessageParam: properties: - id: - type: string - description: >- - The unique identifier for the moderation request. - model: + role: type: string - 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: + 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: - flagged: - type: boolean - 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. - 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. - category_scores: - type: object - additionalProperties: - type: number - description: >- - A list of the categories along with their scores as predicted by model. - user_message: + object: type: string - metadata: - 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 - properties: - data: - type: array - items: - $ref: '#/components/schemas/Prompt' - additionalProperties: false - required: - - data - title: ListPromptsResponse - description: Response model to list prompts. - CreatePromptRequest: - 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: - type: object - properties: - prompt: - 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: - type: object - properties: - version: - type: integer - description: The version to set as default. - additionalProperties: false - required: - - version - title: SetDefaultVersionRequest - ProviderInfo: - 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: - 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: - 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 - 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: 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 - required: - - data - - has_more - - first_id - - last_id - - object - title: ListOpenAIResponseObject - description: >- - Paginated list of OpenAI response objects with navigation metadata. - OpenAIResponseError: - 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 - properties: - type: - 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: + const: embedding + title: Object + default: embedding + embedding: + anyOf: + - items: 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: - 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 - 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: - 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: - 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: - 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: - 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 - 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 - 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: - 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 - 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 - 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: - 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 - 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: array + - type: string + title: Embedding + index: type: integer - additionalProperties: false - required: - - input - - model - title: CreateOpenaiResponseRequest - OpenAIResponseObject: + 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: - created_at: + prompt_tokens: 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: 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 - description: Model identifier used for generation + 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: response - default: response - description: >- - Object type identifier, always "response" - output: - type: array + const: list + title: Object + default: list + data: 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/OpenAIEmbeddingData' type: array - items: - $ref: '#/components/schemas/OpenAIResponseTool' - description: >- - (Optional) An array of tools the model may call while generating a response. - truncation: + title: Data + model: type: string - description: >- - (Optional) Truncation strategy applied to the response + title: Model 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 - 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: + $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: 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 - items: - $ref: '#/components/schemas/OpenAIResponseAnnotations' - description: >- - Structured annotations associated with the text - logprobs: - type: array - items: - 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": + const: file + title: Type + default: file + file: + $ref: '#/components/schemas/OpenAIFileFile' 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 + title: OpenAIFile + OpenAIFileFile: 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": + 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: - 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: + object: type: string - description: >- - Unique identifier of the response containing this content - item_id: + const: file + title: Object + default: file + id: type: string - description: >- - Unique identifier of the output item containing this content part - output_index: + title: Id + bytes: 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: + title: Bytes + created_at: 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: - 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: + title: Created At + expires_at: type: integer - description: >- - Sequential number for ordering streaming events - type: + title: Expires At + filename: 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": + 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: - 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: + url: 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": + 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: - 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: + name: 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": + 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' + OpenAIModel: properties: - item_id: + 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: + title: Id + object: + type: string + const: model + title: Object + default: model + created: type: integer - description: >- - Sequential number for ordering streaming events - type: + title: Created + owned_by: 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: Owned By type: object + required: + - id + - created + - owned_by + title: OpenAIModel + description: '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' + OpenAIResponseAnnotationCitation: properties: - delta: - type: string - description: >- - Incremental function call arguments being added - item_id: + type: type: string - description: >- - Unique identifier of the function call being updated - output_index: + const: url_citation + title: Type + default: url_citation + end_index: type: integer - description: >- - Index position of the item in the output list - sequence_number: + title: End Index + start_index: type: integer - description: >- - Sequential number for ordering streaming events - type: + title: Start Index + title: 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: 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: - arguments: + type: type: string - description: >- - Final complete arguments JSON string for the function call - item_id: + const: container_file_citation + title: Type + default: container_file_citation + container_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: + title: Container Id + end_index: type: integer - description: >- - Sequential number for ordering streaming events - type: + title: End Index + file_id: 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: + title: File Id + filename: 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: + title: Filename + start_index: 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: Start Index type: object + required: + - container_id + - end_index + - file_id + - filename + - start_index + title: OpenAIResponseAnnotationContainerFileCitation + OpenAIResponseAnnotationFileCitation: 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": - type: object - properties: - arguments: + const: file_citation + title: Type + default: file_citation + file_id: type: string - item_id: + title: File Id + filename: type: string - output_index: - type: integer - sequence_number: + title: Filename + index: type: integer - type: - 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: 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: - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events type: 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": + 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: - sequence_number: - type: integer - description: >- - Sequential number for ordering streaming events type: 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": + 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' + OpenAIResponseError: properties: - item_id: + code: 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: + title: Code + message: 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: 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: - 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: 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: - 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: 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: - 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: 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: - 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 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: - 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: - type: string - description: >- - Final complete text content of the output item - item_id: + call_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: + title: Call Id + output: 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 + title: Output 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: 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: 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: 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: - 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: - type: integer - description: >- - Index of the summary part within the reasoning summary + detail: + anyOf: + - type: string + const: low + - type: string + const: high + - type: string + const: auto + title: Detail + default: auto 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: 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 - 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 + title: Text 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_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: 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 - 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 + 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: 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: + const: function + title: Type + default: function + name: 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 + 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' + 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 - 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: + title: Arguments + id: type: string - description: Final complete refusal text - item_id: + title: Id + name: 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: + title: Name + server_label: 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: Server Label 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: 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: - item_id: + approval_request_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 + title: Approval Request Id + approve: + type: boolean + title: Approve 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: 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: - item_id: - type: string - output_index: - type: integer - sequence_number: - type: integer + 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: response.web_search_call.searching - default: response.web_search_call.searching - additionalProperties: false + 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: - - item_id - - output_index - - sequence_number - - type - title: >- - OpenAIResponseObjectStreamResponseWebSearchCallSearching - OpenAIDeleteResponseObject: + - 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.' + 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. + + 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.' + OpenAIResponseObject: properties: + created_at: + type: integer + title: Created At + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' id: type: string - description: >- - Unique identifier of the deleted response + title: Id + model: + type: string + title: Model object: type: string const: response + title: Object 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 + output: items: - $ref: '#/components/schemas/OpenAIResponseInput' - description: List of input items - 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 + title: Output + parallel_tool_calls: + type: boolean + title: Parallel Tool Calls + default: false + previous_response_id: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + status: 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: Status + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + text: + $ref: '#/components/schemas/OpenAIResponseText' + default: + format: + type: text + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + 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 + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions 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' + OpenAIResponseObjectWithInput-Input: properties: - shield_id: + created_at: + type: integer + title: Created At + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + id: type: string - description: The identifier of the shield to run. - messages: - type: array + title: Id + model: + type: string + title: Model + object: + type: string + const: response + title: Object + default: response + output: 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: + - $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 + parallel_tool_calls: + type: boolean + title: Parallel Tool Calls + default: false + previous_response_id: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + status: 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: + title: Status + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + text: + $ref: '#/components/schemas/OpenAIResponseText' + default: + format: + type: text + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + 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 + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + 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 type: object - properties: - type: - type: string - const: agent_turn_input - default: agent_turn_input - 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 + - created_at + - id + - model + - output + - status + - input + title: OpenAIResponseObjectWithInput + description: 'OpenAI response object extended with input context information. + + + :param input: List of input items that led to this response' + OpenAIResponseObjectWithInput-Output: properties: - type: + created_at: + type: integer + title: Created At + error: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseError' + - type: 'null' + id: 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 - description: >- - The type of scoring function parameters, always basic - aggregation_functions: + 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: + anyOf: + - type: string + - type: 'null' + title: Previous Response Id + prompt: + anyOf: + - $ref: '#/components/schemas/OpenAIResponsePrompt' + - type: 'null' + status: + type: string + title: Status + temperature: + anyOf: + - type: number + - type: 'null' + title: Temperature + text: + $ref: '#/components/schemas/OpenAIResponseText' + default: + format: + type: text + top_p: + anyOf: + - type: number + - type: 'null' + title: Top P + 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 + truncation: + anyOf: + - type: string + - type: 'null' + title: Truncation + usage: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsage' + - type: 'null' + instructions: + anyOf: + - type: string + - type: 'null' + title: Instructions + input: 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. - BooleanType: + 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 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 + - created_at + - id + - model + - output + - status + - input + title: OpenAIResponseObjectWithInput + description: 'OpenAI response object extended with input context information. + + + :param input: List of input items that led to this response' + OpenAIResponseOutputMessageContentOutputText: properties: - type: + text: type: string - const: chat_completion_input - default: chat_completion_input - description: >- - Discriminator type. Always "chat_completion_input" - additionalProperties: false - required: - - type - title: ChatCompletionInputType - description: >- - Parameter type for chat completion input. - CompletionInputType: - type: object - properties: + title: Text type: type: string - const: completion_input - default: completion_input - description: >- - Discriminator type. Always "completion_input" - additionalProperties: false - required: - - type - title: CompletionInputType - description: Parameter type for completion input. - JsonType: + 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 - 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: - type: object + - text + title: OpenAIResponseOutputMessageContentOutputText + OpenAIResponseOutputMessageFileSearchToolCall: 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: + id: type: string - description: >- - (Optional) Custom prompt template for the judge model - judge_score_regexes: - type: array + title: Id + queries: 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: + title: Queries + status: 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: + title: Status 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: + 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' + OpenAIResponseOutputMessageFunctionToolCall: properties: - identifier: + call_id: type: string - provider_resource_id: + title: Call Id + name: type: string - provider_id: + title: Name + arguments: type: string + title: Arguments 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: + 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 - 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 + - 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: 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 - properties: - scoring_fn_id: - type: string - description: >- - The ID of the scoring function to register. - description: + const: mcp_call + title: Type + default: mcp_call + arguments: 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: Arguments + name: type: string - description: >- - The ID of the provider scoring function to use for the scoring function. - provider_id: + title: Name + server_label: 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 - 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: + title: Server Label + error: + anyOf: + - type: string + - type: 'null' + title: Error + output: + anyOf: + - type: string + - type: 'null' + title: Output 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 + - 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: - score_rows: - type: array + 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: - 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: + $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: - dataset_id: + 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: + 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: - dataset_id: + 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: + 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: - 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: + 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: - data: - type: array - items: - $ref: '#/components/schemas/Shield' - additionalProperties: false - required: - - data - title: ListShieldsResponse - RegisterShieldRequest: + 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.' + OpenAIResponseToolMCP: properties: - shield_id: - type: string - description: >- - The identifier of the shield to register. - provider_shield_id: + type: type: string - description: >- - The identifier of the shield in the provider. - provider_id: + const: mcp + title: Type + default: mcp + server_label: 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 + title: Server Label + allowed_tools: + anyOf: + - items: + type: string + type: array + - $ref: '#/components/schemas/AllowedToolsFilter' + - type: 'null' + title: Allowed Tools + type: object required: - - shield_id - title: RegisterShieldRequest - CompletionMessage: + - 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: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageInputTokensDetails' + - type: 'null' + output_tokens_details: + anyOf: + - $ref: '#/components/schemas/OpenAIResponseUsageOutputTokensDetails' + - type: 'null' 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' + OpenAISystemMessageParam: properties: role: type: string - const: assistant - default: assistant - description: >- - Must be "assistant" to identify this as the model's response + const: system + title: Role + default: system 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: + 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: - type: + token: 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 + title: Token + bytes: + anyOf: + - items: + type: integer + type: array + - type: 'null' + title: Bytes + logprob: + type: number + title: Logprob + top_logprobs: 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' - Message: - oneOf: - - $ref: '#/components/schemas/UserMessage' - - $ref: '#/components/schemas/SystemMessage' - - $ref: '#/components/schemas/ToolResponseMessage' - - $ref: '#/components/schemas/CompletionMessage' - discriminator: - propertyName: role - mapping: - user: '#/components/schemas/UserMessage' - system: '#/components/schemas/SystemMessage' - tool: '#/components/schemas/ToolResponseMessage' - assistant: '#/components/schemas/CompletionMessage' - SystemMessage: + $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: role: type: string - const: system - default: system - description: >- - Must be "system" to identify this as a system message + const: tool + title: Role + default: tool + tool_call_id: + type: string + title: Tool Call Id 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. - TextContentItem: + 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: - type: string - const: text - default: text - description: >- - Discriminator type of the content item. Always "text" - text: + token: type: string - description: Text content - additionalProperties: false - required: - - type - - text - title: TextContentItem - description: A text content item - ToolCall: + 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: - call_id: - type: string - tool_name: - oneOf: - - type: string - enum: - - brave_search - - wolfram_alpha - - photogen - - code_interpreter - title: BuiltinTool - - type: string - arguments: + role: type: string - additionalProperties: false - required: - - call_id - - tool_name - - arguments - title: ToolCall - ToolResponseMessage: + 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.' + OpenAIUserMessageParam-Output: 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 + const: user + title: Role + default: user content: - $ref: '#/components/schemas/InterleavedContent' - description: The response content from the tool - additionalProperties: false + 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: - - role - - call_id - - content - title: ToolResponseMessage - description: >- - A message representing the result of a tool invocation. - URL: + - 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.' + 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' + PaginatedResponse: properties: - uri: + data: + items: + additionalProperties: true + type: object + type: array + title: Data + has_more: + type: boolean + title: Has More + url: + anyOf: + - type: string + - type: 'null' + title: Url + type: object + required: + - data + - has_more + title: 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' + PostTrainingJobStatusResponse: + properties: + job_uuid: type: string - description: The URL string pointing to the resource - additionalProperties: false + 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: - - uri - title: URL - description: A URL reference to external content. - UserMessage: + - job_uuid + - status + title: 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' + PostTrainingMetric: + properties: + epoch: + type: integer + title: Epoch + train_loss: + type: number + title: Train Loss + validation_loss: + type: number + title: Validation Loss + perplexity: + type: number + title: Perplexity type: object + required: + - epoch + - train_loss + - validation_loss + - perplexity + title: 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' + Prompt: properties: - role: + 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 - 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. - SyntheticDataGenerateRequest: + 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. + + + :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: - dialogs: - type: array - items: - $ref: '#/components/schemas/Message' - description: >- - List of conversation messages to use as input for synthetic data generation - filtering_function: + api: type: string - enum: - - none - - random - - top_k - - top_p - - top_k_top_p - - sigmoid - description: >- - Type of filtering to apply to generated synthetic data samples - model: + title: Api + provider_id: type: string - description: >- - (Optional) The identifier of the model to use. The model must be registered - with Llama Stack and available via the /models endpoint - additionalProperties: false - required: - - dialogs - - filtering_function - title: SyntheticDataGenerateRequest - SyntheticDataGenerationResponse: + 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. + + + :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' + QueryChunksResponse: properties: - synthetic_data: + chunks: + items: + $ref: '#/components/schemas/Chunk-Output' type: array + title: Chunks + scores: items: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - List of generated synthetic data samples that passed the filtering criteria - statistics: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Statistical information about the generation process and filtering - results - additionalProperties: false + type: number + type: array + title: Scores + type: object required: - - synthetic_data - title: SyntheticDataGenerationResponse - description: >- - Response from the synthetic data generation. Batch of (prompt, response, score) - tuples that pass the threshold. - InvokeToolRequest: + - 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' + 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. + + + :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: - 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 - ToolInvocationResult: + 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)' + SafetyViolation: 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 + violation_level: + $ref: '#/components/schemas/ViolationLevel' + user_message: + anyOf: + - type: string + - type: 'null' + title: User Message metadata: + additionalProperties: true 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. - ToolDef: + 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: - toolgroup_id: + 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." + ScoringFn: + properties: + identifier: type: string - description: >- - (Optional) ID of the tool group this tool belongs to - name: + 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: Name of the tool - description: + title: Provider Id + description: ID of the provider that owns this resource + type: 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) + 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: >- - (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 + 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. + + :param type: The resource type, always scoring_function' + Session: properties: - document_id: + session_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: Session Id + session_name: 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 + title: Session Name + turns: items: - $ref: '#/components/schemas/RAGDocument' - description: >- - List of documents to index in the RAG system - vector_store_id: + $ref: '#/components/schemas/Turn' + type: array + title: Turns + 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 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 + - session_id + - session_name + - turns + - started_at + title: 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' + Shield: properties: - type: + identifier: type: string - const: llm - default: llm - description: Type of query generator, always 'llm' - model: + 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: >- - Name of the language model to use for query generation - template: + title: Provider Id + description: ID of the provider that owns this resource + type: type: string - description: >- - Template string for formatting the query generation prompt - additionalProperties: false + 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' + ShieldCallStep-Input: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + 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 + step_type: + type: string + const: shield_call + title: Step Type + default: shield_call + violation: + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' + type: object required: - - type - - model - - template - title: LLMRAGQueryGeneratorConfig - description: >- - Configuration for the LLM-based RAG query generator. - RAGQueryConfig: + - turn_id + - step_id + - violation + title: ShieldCallStep + description: 'A shield call step in an agent turn. + + + :param violation: The violation from the shield call.' + ShieldCallStep-Output: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + 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 + step_type: + type: string + const: shield_call + title: Step Type + default: shield_call + violation: + anyOf: + - $ref: '#/components/schemas/SafetyViolation' + - type: 'null' 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} - - 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: + 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: - - 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: + - 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. + + + :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." + 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: - type: + 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: + toolgroup_id: + anyOf: + - type: string + - type: 'null' + title: Toolgroup Id + name: 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: + 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: + - 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' + ToolExecutionStep-Input: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + 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 + 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 - 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 required: - - type - - alpha - title: WeightedRanker - description: >- - Weighted ranker configuration that combines vector and keyword scores. - QueryRequest: - type: object - properties: - content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - The query content to search for in the indexed documents - vector_store_ids: + - 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.' + ToolExecutionStep-Output: + properties: + turn_id: + type: string + title: Turn Id + step_id: + type: string + title: Step Id + 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 + 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: - 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 - required: - - content - - vector_store_ids - title: QueryRequest - RAGQueryResult: + $ref: '#/components/schemas/ToolResponse-Output' + type: array + title: Tool Responses type: object - properties: - content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - (Optional) The retrieved content from the query - 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 - description: >- - Result of a RAG query containing retrieved content and metadata. + 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.' ToolGroup: - type: object 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 + title: Type 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 + anyOf: + - $ref: '#/components/schemas/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 - 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 - description: >- - Response containing a list of tool groups. - RegisterToolGroupRequest: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Args type: object - properties: - toolgroup_id: - type: string - description: The ID of the tool group to register. - provider_id: - 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: - type: object + - 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' + ToolInvocationResult: properties: content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - The content of the chunk, which can be interleaved text, images, or other - types. + 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 + error_message: + anyOf: + - type: string + - type: 'null' + title: Error Message + error_code: + anyOf: + - type: integer + - type: 'null' + title: Error Code 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. - stored_chunk_id: - type: string - description: >- - The chunk ID that is stored in the vector database. Used for backend functionality. - 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 - - metadata - title: Chunk - description: >- - A chunk of content that can be inserted into a vector database. - ChunkMetadata: + anyOf: + - additionalProperties: true + type: object + - type: 'null' + title: Metadata 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' + 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: - 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: + call_id: 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: + 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 - 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 + - 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: - vector_store_id: + call_id: 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 - required: - - vector_store_id - - query - title: QueryChunksRequest - QueryChunksResponse: + 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 - properties: - chunks: - type: array - items: - $ref: '#/components/schemas/Chunk' - description: >- - List of content chunks returned from the query - scores: - type: array - items: - type: number - description: >- - Relevance scores corresponding to each returned chunk - additionalProperties: false 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 - description: >- - Number of files currently being processed - total: - type: integer - 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 + - 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' + ToolResponseMessage-Input: 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: + role: type: string - description: >- - (Optional) ID of the first vector store in the list for pagination - last_id: + const: tool + title: Role + default: tool + call_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: + 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. + + + :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' + ToolResponseMessage-Output: properties: - id: - type: string - description: Unique identifier for the vector store - object: + role: type: string - default: vector_store - description: >- - Object type identifier, always "vector_store" - created_at: - type: integer - description: >- - Timestamp when the vector store was created - name: + const: tool + title: Role + default: tool + call_id: type: string - description: (Optional) Name of the vector store - usage_bytes: - 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: 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: 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: + const: top_k + title: Type + default: top_k + top_k: 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 - required: - - id - - object - - created_at - - usage_bytes - - file_counts - - status - - metadata - title: VectorStoreObject - description: OpenAI Vector Store object. - "OpenAICreateVectorStoreRequestWithExtraBody": + 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: - name: + type: type: string - description: (Optional) A name for the vector store - file_ids: + const: top_p + title: Type + default: top_p + temperature: + anyOf: + - type: number + exclusiveMinimum: 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. + + + :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: + 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. + + + :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)' + 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: - 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 + - $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: + anyOf: + - items: + $ref: '#/components/schemas/Attachment-Output' + type: array + - type: 'null' + title: Output Attachments + started_at: + type: string + format: date-time + title: Started At + completed_at: + anyOf: + - type: string + format: date-time + - type: 'null' + title: Completed At + 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' + URL: properties: - name: + uri: 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: + 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-Input: properties: - id: + role: type: string - description: >- - Unique identifier of the deleted vector store - object: + 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. + + + :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.' + UserMessage-Output: + properties: + role: 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 + 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: - - 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' + - 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.' VectorStoreChunkingStrategyAuto: - type: object properties: type: type: string const: auto + title: Type default: auto - description: >- - Strategy type, always "auto" for automatic chunking - additionalProperties: false - required: - - type + type: object title: VectorStoreChunkingStrategyAuto - description: >- - Automatic chunking strategy for vector store files. + description: 'Automatic chunking strategy for vector store files. + + + :param type: Strategy type, always "auto" for automatic chunking' VectorStoreChunkingStrategyStatic: - type: object properties: type: type: string const: static + title: Type 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 + type: object required: - - type - - static + - static title: VectorStoreChunkingStrategyStatic - description: >- - Static chunking strategy with configurable parameters. + 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: - type: object properties: chunk_overlap_tokens: type: integer + title: Chunk Overlap Tokens default: 400 - description: >- - Number of tokens to overlap between adjacent chunks max_chunk_size_tokens: type: integer + maximum: 4096.0 + minimum: 100.0 + title: Max Chunk Size Tokens 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 + type: object title: VectorStoreChunkingStrategyStaticConfig - description: >- - Configuration for static chunking strategy. - "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": + 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' + 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' + VectorStoreDeleteResponse: 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 - required: - - file_ids - title: >- - OpenAICreateVectorStoreFileBatchRequestWithExtraBody - description: >- - Request to create a vector store file batch with extra_body support. - VectorStoreFileBatchObject: + 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. + + + :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' + VectorStoreFileBatchObject: properties: id: type: string - description: Unique identifier for the file batch + title: Id object: type: string + title: Object 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 + title: Created At vector_store_id: type: string - description: >- - ID of the vector store containing the file batch + title: Vector Store Id status: - $ref: '#/components/schemas/VectorStoreFileStatus' - description: >- - Current processing status of the file batch + 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' - description: >- - File processing status counts for the batch - additionalProperties: false - required: - - id - - object - - created_at - - vector_store_id - - status - - file_counts + type: object + required: + - id + - 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: + 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' + 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. + + + :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' + 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' + 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. + + + :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' + VectorStoreFileLastError: properties: code: - oneOf: - - type: string - const: server_error - - type: string - const: rate_limit_exceeded - description: >- - Error code indicating the type of failure + anyOf: + - type: string + const: server_error + - type: string + const: rate_limit_exceeded + title: Code message: type: string - description: >- - Human-readable error message describing the failure - additionalProperties: false + title: Message + type: object required: - - code - - message + - code + - message title: VectorStoreFileLastError - description: >- - Error information for failed vector store file processing. + 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: - type: object properties: id: type: string - description: Unique identifier for the file + title: Id object: type: string + title: Object default: vector_store.file - description: >- - Object type identifier, always "vector_store.file" attributes: + 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 + title: Attributes chunking_strategy: oneOf: - - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' - - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyAuto' + - $ref: '#/components/schemas/VectorStoreChunkingStrategyStatic' + title: Chunking Strategy 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 + title: Created At last_error: - $ref: '#/components/schemas/VectorStoreFileLastError' - description: >- - (Optional) Error information if file processing failed + anyOf: + - $ref: '#/components/schemas/VectorStoreFileLastError' + - type: 'null' status: - $ref: '#/components/schemas/VectorStoreFileStatus' - description: Current processing status of the file + 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 - 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: Vector Store Id + type: object + required: + - id + - chunking_strategy + - created_at + - status + - vector_store_id title: VectorStoreFileObject - description: OpenAI Vector Store File 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' VectorStoreFilesListInBatchResponse: - type: object properties: object: type: string + title: Object 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 + type: array + title: Data first_id: - type: string - description: >- - (Optional) ID of the first file in the list for pagination + anyOf: + - type: string + - type: 'null' + title: First Id last_id: - type: string - description: >- - (Optional) ID of the last file in the list for pagination + anyOf: + - type: string + - type: 'null' + title: Last Id has_more: type: boolean + title: Has More default: false - description: >- - Whether there are more files available beyond this page - additionalProperties: false + type: object required: - - object - - data - - has_more + - data title: VectorStoreFilesListInBatchResponse - description: >- - Response from listing files in a vector store file batch. + 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' VectorStoreListFilesResponse: - type: object properties: object: type: string + title: Object default: list - description: Object type identifier, always "list" data: - type: array items: $ref: '#/components/schemas/VectorStoreFileObject' - description: List of vector store file objects + type: array + title: Data first_id: - type: string - description: >- - (Optional) ID of the first file in the list for pagination + anyOf: + - type: string + - type: 'null' + title: First Id last_id: - type: string - description: >- - (Optional) ID of the last file in the list for pagination + anyOf: + - type: string + - type: 'null' + title: Last Id has_more: type: boolean + title: Has More 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 + - data + title: 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' + VectorStoreListResponse: properties: - 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 - deleted: + 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 - default: true - description: >- - Whether the deletion operation was successful - additionalProperties: false - required: - - id - - object - - deleted - title: VectorStoreFileDeleteResponse - description: >- - Response from deleting a vector store file. - VectorStoreContent: + title: Has More + default: false 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 + - data + title: 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' + VectorStoreObject: properties: - file_id: + id: type: string - description: Unique identifier for the file - filename: + title: Id + object: 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 - description: >- - Filters based on file attributes to narrow the search results. - max_num_results: + title: Object + default: vector_store + created_at: 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: + 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: >- - The search mode to use - "keyword", "vector", or "hybrid" (default "vector") - 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: - - query - title: OpenaiSearchVectorStoreRequest + - 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' VectorStoreSearchResponse: - type: object properties: file_id: type: string - description: >- - Unique identifier of the file containing the result + title: File Id filename: type: string - description: Name of the file containing the result + title: Filename score: type: number - description: Relevance score for this search result + title: Score attributes: - type: object - additionalProperties: - oneOf: + anyOf: + - additionalProperties: + anyOf: - type: string - type: number - type: boolean - description: >- - (Optional) Key-value attributes associated with the file + type: object + - type: 'null' + title: Attributes content: - type: array items: $ref: '#/components/schemas/VectorStoreContent' - description: >- - List of content items matching the search query - additionalProperties: false - required: - - file_id - - filename - - score - - content + type: array + title: Content + type: object + required: + - file_id + - filename + - score + - content title: VectorStoreSearchResponse - description: Response from searching a vector store. + 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: - type: object properties: object: type: string + title: Object default: vector_store.search_results.page - description: >- - Object type identifier for the search results page search_query: type: string - description: >- - The original search query that was executed + title: Search Query data: - type: array items: $ref: '#/components/schemas/VectorStoreSearchResponse' - description: List of search result objects + type: array + title: Data has_more: type: boolean + title: Has More default: false - description: >- - Whether there are more results available beyond this page next_page: - type: string - description: >- - (Optional) Token for retrieving the next page of results - additionalProperties: false + anyOf: + - type: string + - type: 'null' + title: Next Page + type: object required: - - object - - search_query - - data - - has_more + - search_query + - data title: VectorStoreSearchResponsePage - description: >- - Paginated response from searching a vector store. - VersionInfo: - 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' + 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' + 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: - version: + status: + title: Status + type: integer + title: + title: Title type: string - description: Version number of the service - additionalProperties: false - required: - - version - title: VersionInfo - description: Version information for the service. + detail: + title: Detail + type: string + instance: + anyOf: + - type: string + - type: 'null' + default: null + title: Instance + required: + - status + - title + - detail + title: Error + type: object + AgentTool: + oneOf: + - type: string + - type: object + properties: + name: + type: string + args: + type: object + required: + - name + - args + title: AgentToolGroupWithArgs responses: BadRequest400: description: The request was invalid or malformed @@ -10028,8 +9429,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: @@ -10037,11 +9437,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: @@ -10049,174 +9447,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. - - - ## 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: 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: SyntheticDataGeneration (Coming Soon) - description: '' - - name: ToolGroups - description: '' - - name: ToolRuntime - description: '' - - name: VectorIO - description: '' -x-tagGroups: - - name: Operations - tags: - - Agents - - Conversations - - Files - - Inference - - Inspect - - Models - - Prompts - - Providers - - Safety - - Scoring - - ScoringFunctions - - Shields - - SyntheticDataGeneration (Coming Soon) - - ToolGroups - - ToolRuntime - - VectorIO diff --git a/docs/static/stainless-llama-stack-spec.html b/docs/static/stainless-llama-stack-spec.html index daa5db20e6..288cffcca1 100644 --- a/docs/static/stainless-llama-stack-spec.html +++ b/docs/static/stainless-llama-stack-spec.html @@ -28,18056 +28,21729 @@