diff --git a/api_update_plan.md b/api_update_plan.md index e653ac566..3237b3a69 100644 --- a/api_update_plan.md +++ b/api_update_plan.md @@ -210,7 +210,7 @@ Before finalizing documentation, verify: 4. Move to next file **COMPLETION CRITERIA:** -- All 22 files have been processed +- All 29 files have been processed - All @json_schema_type classes have comprehensive docstrings with complete `:param` field documentation - All @webmethod functions have comprehensive docstrings with parameter and return documentation - All other BaseModel classes have comprehensive docstrings with `:param` field documentation @@ -247,6 +247,7 @@ Before finalizing documentation, verify: [x] 26. `/Users/saip/Documents/GitHub/llama-stack-sai/llama_stack/apis/common/training_types.py` - Training metrics and checkpoint types [x] 27. `/Users/saip/Documents/GitHub/llama-stack-sai/llama_stack/apis/common/responses.py` - Generic response types (well documented) [x] 28. `/Users/saip/Documents/GitHub/llama-stack-sai/llama_stack/apis/common/type_system.py` - Parameter type system definitions +[x] 29. `/Users/saip/Documents/GitHub/llama-stack-sai/llama_stack/apis/agents/openai_responses.py` - OpenAI Response API compatibility types **NOTE:** `/Users/saip/Documents/GitHub/llama-stack-sai/llama_stack/apis/common/errors.py` contains only Python exception classes (no @json_schema_type), so it's not included in the documentation update scope. @@ -630,7 +631,7 @@ After processing all 22 files: 4. Check that the documentation is comprehensive and consistent ## Success Indicators -- [ ] All 22 API files processed +- [ ] All 29 API files processed - [ ] All @json_schema_type classes have comprehensive docstrings with `:param` field documentation - [ ] All @webmethod functions have comprehensive docstrings with parameter and return documentation - [ ] OpenAPI spec contains comprehensive field descriptions diff --git a/docs/_static/llama-stack-spec.html b/docs/_static/llama-stack-spec.html index 9a8b92b15..18fa2c982 100644 --- a/docs/_static/llama-stack-spec.html +++ b/docs/_static/llama-stack-spec.html @@ -7522,19 +7522,24 @@ "type": { "type": "string", "const": "url_citation", - "default": "url_citation" + "default": "url_citation", + "description": "Annotation type identifier, always \"url_citation\"" }, "end_index": { - "type": "integer" + "type": "integer", + "description": "End position of the citation span in the content" }, "start_index": { - "type": "integer" + "type": "integer", + "description": "Start position of the citation span in the content" }, "title": { - "type": "string" + "type": "string", + "description": "Title of the referenced web resource" }, "url": { - "type": "string" + "type": "string", + "description": "URL of the referenced web resource" } }, "additionalProperties": false, @@ -7545,7 +7550,8 @@ "title", "url" ], - "title": "OpenAIResponseAnnotationCitation" + "title": "OpenAIResponseAnnotationCitation", + "description": "URL citation annotation for referencing external web resources." }, "OpenAIResponseAnnotationContainerFileCitation": { "type": "object", @@ -7588,16 +7594,20 @@ "type": { "type": "string", "const": "file_citation", - "default": "file_citation" + "default": "file_citation", + "description": "Annotation type identifier, always \"file_citation\"" }, "file_id": { - "type": "string" + "type": "string", + "description": "Unique identifier of the referenced file" }, "filename": { - "type": "string" + "type": "string", + "description": "Name of the referenced file" }, "index": { - "type": "integer" + "type": "integer", + "description": "Position index of the citation within the content" } }, "additionalProperties": false, @@ -7607,7 +7617,8 @@ "filename", "index" ], - "title": "OpenAIResponseAnnotationFileCitation" + "title": "OpenAIResponseAnnotationFileCitation", + "description": "File citation annotation for referencing specific files in response content." }, "OpenAIResponseAnnotationFilePath": { "type": "object", @@ -7741,15 +7752,18 @@ "const": "auto" } ], - "default": "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" + "default": "input_image", + "description": "Content type identifier, always \"input_image\"" }, "image_url": { - "type": "string" + "type": "string", + "description": "(Optional) URL of the image content" } }, "additionalProperties": false, @@ -7757,18 +7771,21 @@ "detail", "type" ], - "title": "OpenAIResponseInputMessageContentImage" + "title": "OpenAIResponseInputMessageContentImage", + "description": "Image content for input messages in OpenAI response format." }, "OpenAIResponseInputMessageContentText": { "type": "object", "properties": { "text": { - "type": "string" + "type": "string", + "description": "The text content of the input message" }, "type": { "type": "string", "const": "input_text", - "default": "input_text" + "default": "input_text", + "description": "Content type identifier, always \"input_text\"" } }, "additionalProperties": false, @@ -7776,7 +7793,8 @@ "text", "type" ], - "title": "OpenAIResponseInputMessageContentText" + "title": "OpenAIResponseInputMessageContentText", + "description": "Text content for input messages in OpenAI response format." }, "OpenAIResponseInputTool": { "oneOf": [ @@ -7809,13 +7827,15 @@ "type": { "type": "string", "const": "file_search", - "default": "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", @@ -7840,11 +7860,13 @@ "type": "object" } ] - } + }, + "description": "(Optional) Additional filters to apply to the search" }, "max_num_results": { "type": "integer", - "default": 10 + "default": 10, + "description": "(Optional) Maximum number of search results to return (1-50)" }, "ranking_options": { "type": "object", @@ -7860,8 +7882,7 @@ } }, "additionalProperties": false, - "title": "SearchRankingOptions", - "description": "Options for ranking and filtering search results." + "description": "(Optional) Options for ranking and scoring search results" } }, "additionalProperties": false, @@ -7869,7 +7890,8 @@ "type", "vector_store_ids" ], - "title": "OpenAIResponseInputToolFileSearch" + "title": "OpenAIResponseInputToolFileSearch", + "description": "File search tool configuration for OpenAI response inputs." }, "OpenAIResponseInputToolFunction": { "type": "object", @@ -7877,13 +7899,16 @@ "type": { "type": "string", "const": "function", - "default": "function" + "default": "function", + "description": "Tool type identifier, always \"function\"" }, "name": { - "type": "string" + "type": "string", + "description": "Name of the function that can be called" }, "description": { - "type": "string" + "type": "string", + "description": "(Optional) Description of what the function does" }, "parameters": { "type": "object", @@ -7908,10 +7933,12 @@ "type": "object" } ] - } + }, + "description": "(Optional) JSON schema defining the function's parameters" }, "strict": { - "type": "boolean" + "type": "boolean", + "description": "(Optional) Whether to enforce strict parameter validation" } }, "additionalProperties": false, @@ -7919,7 +7946,8 @@ "type", "name" ], - "title": "OpenAIResponseInputToolFunction" + "title": "OpenAIResponseInputToolFunction", + "description": "Function tool configuration for OpenAI response inputs." }, "OpenAIResponseInputToolMCP": { "type": "object", @@ -7927,13 +7955,16 @@ "type": { "type": "string", "const": "mcp", - "default": "mcp" + "default": "mcp", + "description": "Tool type identifier, always \"mcp\"" }, "server_label": { - "type": "string" + "type": "string", + "description": "Label to identify this MCP server" }, "server_url": { - "type": "string" + "type": "string", + "description": "URL endpoint of the MCP server" }, "headers": { "type": "object", @@ -7958,7 +7989,8 @@ "type": "object" } ] - } + }, + "description": "(Optional) HTTP headers to include when connecting to the server" }, "require_approval": { "oneOf": [ @@ -7977,20 +8009,24 @@ "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" + "title": "ApprovalFilter", + "description": "Filter configuration for MCP tool approval requirements." } ], - "default": "never" + "default": "never", + "description": "Approval requirement for tool calls (\"always\", \"never\", or filter)" }, "allowed_tools": { "oneOf": [ @@ -8007,13 +8043,16 @@ "type": "array", "items": { "type": "string" - } + }, + "description": "(Optional) List of specific tool names that are allowed" } }, "additionalProperties": false, - "title": "AllowedToolsFilter" + "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, @@ -8023,7 +8062,8 @@ "server_url", "require_approval" ], - "title": "OpenAIResponseInputToolMCP" + "title": "OpenAIResponseInputToolMCP", + "description": "Model Context Protocol (MCP) tool configuration for OpenAI response inputs." }, "OpenAIResponseInputToolWebSearch": { "type": "object", @@ -8043,18 +8083,21 @@ "const": "web_search_preview_2025_03_11" } ], - "default": "web_search" + "default": "web_search", + "description": "Web search tool type variant to use" }, "search_context_size": { "type": "string", - "default": "medium" + "default": "medium", + "description": "(Optional) Size of search context, must be \"low\", \"medium\", or \"high\"" } }, "additionalProperties": false, "required": [ "type" ], - "title": "OpenAIResponseInputToolWebSearch" + "title": "OpenAIResponseInputToolWebSearch", + "description": "Web search tool configuration for OpenAI response inputs." }, "OpenAIResponseMessage": { "type": "object", @@ -8149,21 +8192,25 @@ "type": "object", "properties": { "id": { - "type": "string" + "type": "string", + "description": "Unique identifier for this tool call" }, "queries": { "type": "array", "items": { "type": "string" - } + }, + "description": "List of search queries executed" }, "status": { - "type": "string" + "type": "string", + "description": "Current status of the file search operation" }, "type": { "type": "string", "const": "file_search_call", - "default": "file_search_call" + "default": "file_search_call", + "description": "Tool call type identifier, always \"file_search_call\"" }, "results": { "type": "array", @@ -8191,7 +8238,8 @@ } ] } - } + }, + "description": "(Optional) Search results returned by the file search operation" } }, "additionalProperties": false, @@ -8201,30 +8249,37 @@ "status", "type" ], - "title": "OpenAIResponseOutputMessageFileSearchToolCall" + "title": "OpenAIResponseOutputMessageFileSearchToolCall", + "description": "File search tool call output message for OpenAI responses." }, "OpenAIResponseOutputMessageFunctionToolCall": { "type": "object", "properties": { "call_id": { - "type": "string" + "type": "string", + "description": "Unique identifier for the function call" }, "name": { - "type": "string" + "type": "string", + "description": "Name of the function being called" }, "arguments": { - "type": "string" + "type": "string", + "description": "JSON string containing the function arguments" }, "type": { "type": "string", "const": "function_call", - "default": "function_call" + "default": "function_call", + "description": "Tool call type identifier, always \"function_call\"" }, "id": { - "type": "string" + "type": "string", + "description": "(Optional) Additional identifier for the tool call" }, "status": { - "type": "string" + "type": "string", + "description": "(Optional) Current status of the function call execution" } }, "additionalProperties": false, @@ -8234,21 +8289,25 @@ "arguments", "type" ], - "title": "OpenAIResponseOutputMessageFunctionToolCall" + "title": "OpenAIResponseOutputMessageFunctionToolCall", + "description": "Function tool call output message for OpenAI responses." }, "OpenAIResponseOutputMessageWebSearchToolCall": { "type": "object", "properties": { "id": { - "type": "string" + "type": "string", + "description": "Unique identifier for this tool call" }, "status": { - "type": "string" + "type": "string", + "description": "Current status of the web search operation" }, "type": { "type": "string", "const": "web_search_call", - "default": "web_search_call" + "default": "web_search_call", + "description": "Tool call type identifier, always \"web_search_call\"" } }, "additionalProperties": false, @@ -8257,7 +8316,8 @@ "status", "type" ], - "title": "OpenAIResponseOutputMessageWebSearchToolCall" + "title": "OpenAIResponseOutputMessageWebSearchToolCall", + "description": "Web search tool call output message for OpenAI responses." }, "OpenAIResponseText": { "type": "object", @@ -8325,12 +8385,12 @@ "required": [ "type" ], - "title": "OpenAIResponseTextFormat", - "description": "Configuration for Responses API text format." + "description": "(Optional) Text format configuration specifying output format requirements" } }, "additionalProperties": false, - "title": "OpenAIResponseText" + "title": "OpenAIResponseText", + "description": "Text response configuration for OpenAI responses." }, "CreateOpenaiResponseRequest": { "type": "object", @@ -8393,10 +8453,12 @@ "type": "object", "properties": { "code": { - "type": "string" + "type": "string", + "description": "Error code identifying the type of failure" }, "message": { - "type": "string" + "type": "string", + "description": "Human-readable error message describing the failure" } }, "additionalProperties": false, @@ -8404,58 +8466,73 @@ "code", "message" ], - "title": "OpenAIResponseError" + "title": "OpenAIResponseError", + "description": "Error details for failed OpenAI response requests." }, "OpenAIResponseObject": { "type": "object", "properties": { "created_at": { - "type": "integer" + "type": "integer", + "description": "Unix timestamp when the response was created" }, "error": { - "$ref": "#/components/schemas/OpenAIResponseError" + "$ref": "#/components/schemas/OpenAIResponseError", + "description": "(Optional) Error details if the response generation failed" }, "id": { - "type": "string" + "type": "string", + "description": "Unique identifier for this response" }, "model": { - "type": "string" + "type": "string", + "description": "Model identifier used for generation" }, "object": { "type": "string", "const": "response", - "default": "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 + "default": false, + "description": "Whether tool calls can be executed in parallel" }, "previous_response_id": { - "type": "string" + "type": "string", + "description": "(Optional) ID of the previous response in a conversation" }, "status": { - "type": "string" + "type": "string", + "description": "Current status of the response generation" }, "temperature": { - "type": "number" + "type": "number", + "description": "(Optional) Sampling temperature used for generation" }, "text": { - "$ref": "#/components/schemas/OpenAIResponseText" + "$ref": "#/components/schemas/OpenAIResponseText", + "description": "Text formatting configuration for the response" }, "top_p": { - "type": "number" + "type": "number", + "description": "(Optional) Nucleus sampling parameter used for generation" }, "truncation": { - "type": "string" + "type": "string", + "description": "(Optional) Truncation strategy applied to the response" }, "user": { - "type": "string" + "type": "string", + "description": "(Optional) User identifier associated with the request" } }, "additionalProperties": false, @@ -8469,7 +8546,8 @@ "status", "text" ], - "title": "OpenAIResponseObject" + "title": "OpenAIResponseObject", + "description": "Complete OpenAI response object containing generation results and metadata." }, "OpenAIResponseOutput": { "oneOf": [ @@ -8508,27 +8586,34 @@ "type": "object", "properties": { "id": { - "type": "string" + "type": "string", + "description": "Unique identifier for this MCP call" }, "type": { "type": "string", "const": "mcp_call", - "default": "mcp_call" + "default": "mcp_call", + "description": "Tool call type identifier, always \"mcp_call\"" }, "arguments": { - "type": "string" + "type": "string", + "description": "JSON string containing the MCP call arguments" }, "name": { - "type": "string" + "type": "string", + "description": "Name of the MCP method being called" }, "server_label": { - "type": "string" + "type": "string", + "description": "Label identifying the MCP server handling the call" }, "error": { - "type": "string" + "type": "string", + "description": "(Optional) Error message if the MCP call failed" }, "output": { - "type": "string" + "type": "string", + "description": "(Optional) Output result from the successful MCP call" } }, "additionalProperties": false, @@ -8539,21 +8624,25 @@ "name", "server_label" ], - "title": "OpenAIResponseOutputMessageMCPCall" + "title": "OpenAIResponseOutputMessageMCPCall", + "description": "Model Context Protocol (MCP) call output message for OpenAI responses." }, "OpenAIResponseOutputMessageMCPListTools": { "type": "object", "properties": { "id": { - "type": "string" + "type": "string", + "description": "Unique identifier for this MCP list tools operation" }, "type": { "type": "string", "const": "mcp_list_tools", - "default": "mcp_list_tools" + "default": "mcp_list_tools", + "description": "Tool call type identifier, always \"mcp_list_tools\"" }, "server_label": { - "type": "string" + "type": "string", + "description": "Label identifying the MCP server providing the tools" }, "tools": { "type": "array", @@ -8583,13 +8672,16 @@ "type": "object" } ] - } + }, + "description": "JSON schema defining the tool's input parameters" }, "name": { - "type": "string" + "type": "string", + "description": "Name of the tool" }, "description": { - "type": "string" + "type": "string", + "description": "(Optional) Description of what the tool does" } }, "additionalProperties": false, @@ -8597,8 +8689,10 @@ "input_schema", "name" ], - "title": "MCPListToolsTool" - } + "title": "MCPListToolsTool", + "description": "Tool definition returned by MCP list tools operation." + }, + "description": "List of available tools provided by the MCP server" } }, "additionalProperties": false, @@ -8608,7 +8702,8 @@ "server_label", "tools" ], - "title": "OpenAIResponseOutputMessageMCPListTools" + "title": "OpenAIResponseOutputMessageMCPListTools", + "description": "MCP list tools output message containing available tools from an MCP server." }, "OpenAIResponseObjectStream": { "oneOf": [ @@ -8699,12 +8794,14 @@ "type": "object", "properties": { "response": { - "$ref": "#/components/schemas/OpenAIResponseObject" + "$ref": "#/components/schemas/OpenAIResponseObject", + "description": "The completed response object" }, "type": { "type": "string", "const": "response.completed", - "default": "response.completed" + "default": "response.completed", + "description": "Event type identifier, always \"response.completed\"" } }, "additionalProperties": false, @@ -8712,18 +8809,21 @@ "response", "type" ], - "title": "OpenAIResponseObjectStreamResponseCompleted" + "title": "OpenAIResponseObjectStreamResponseCompleted", + "description": "Streaming event indicating a response has been completed." }, "OpenAIResponseObjectStreamResponseCreated": { "type": "object", "properties": { "response": { - "$ref": "#/components/schemas/OpenAIResponseObject" + "$ref": "#/components/schemas/OpenAIResponseObject", + "description": "The newly created response object" }, "type": { "type": "string", "const": "response.created", - "default": "response.created" + "default": "response.created", + "description": "Event type identifier, always \"response.created\"" } }, "additionalProperties": false, @@ -8731,27 +8831,33 @@ "response", "type" ], - "title": "OpenAIResponseObjectStreamResponseCreated" + "title": "OpenAIResponseObjectStreamResponseCreated", + "description": "Streaming event indicating a new response has been created." }, "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta": { "type": "object", "properties": { "delta": { - "type": "string" + "type": "string", + "description": "Incremental function call arguments being added" }, "item_id": { - "type": "string" + "type": "string", + "description": "Unique identifier of the function call being updated" }, "output_index": { - "type": "integer" + "type": "integer", + "description": "Index position of the item in the output list" }, "sequence_number": { - "type": "integer" + "type": "integer", + "description": "Sequential number for ordering streaming events" }, "type": { "type": "string", "const": "response.function_call_arguments.delta", - "default": "response.function_call_arguments.delta" + "default": "response.function_call_arguments.delta", + "description": "Event type identifier, always \"response.function_call_arguments.delta\"" } }, "additionalProperties": false, @@ -8762,27 +8868,33 @@ "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta" + "title": "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta", + "description": "Streaming event for incremental function call argument updates." }, "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone": { "type": "object", "properties": { "arguments": { - "type": "string" + "type": "string", + "description": "Final complete arguments JSON string for the function call" }, "item_id": { - "type": "string" + "type": "string", + "description": "Unique identifier of the completed function call" }, "output_index": { - "type": "integer" + "type": "integer", + "description": "Index position of the item in the output list" }, "sequence_number": { - "type": "integer" + "type": "integer", + "description": "Sequential number for ordering streaming events" }, "type": { "type": "string", "const": "response.function_call_arguments.done", - "default": "response.function_call_arguments.done" + "default": "response.function_call_arguments.done", + "description": "Event type identifier, always \"response.function_call_arguments.done\"" } }, "additionalProperties": false, @@ -8793,7 +8905,8 @@ "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone" + "title": "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone", + "description": "Streaming event for when function call arguments are completed." }, "OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta": { "type": "object", @@ -8861,12 +8974,14 @@ "type": "object", "properties": { "sequence_number": { - "type": "integer" + "type": "integer", + "description": "Sequential number for ordering streaming events" }, "type": { "type": "string", "const": "response.mcp_call.completed", - "default": "response.mcp_call.completed" + "default": "response.mcp_call.completed", + "description": "Event type identifier, always \"response.mcp_call.completed\"" } }, "additionalProperties": false, @@ -8874,18 +8989,21 @@ "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseMcpCallCompleted" + "title": "OpenAIResponseObjectStreamResponseMcpCallCompleted", + "description": "Streaming event for completed MCP calls." }, "OpenAIResponseObjectStreamResponseMcpCallFailed": { "type": "object", "properties": { "sequence_number": { - "type": "integer" + "type": "integer", + "description": "Sequential number for ordering streaming events" }, "type": { "type": "string", "const": "response.mcp_call.failed", - "default": "response.mcp_call.failed" + "default": "response.mcp_call.failed", + "description": "Event type identifier, always \"response.mcp_call.failed\"" } }, "additionalProperties": false, @@ -8893,24 +9011,29 @@ "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseMcpCallFailed" + "title": "OpenAIResponseObjectStreamResponseMcpCallFailed", + "description": "Streaming event for failed MCP calls." }, "OpenAIResponseObjectStreamResponseMcpCallInProgress": { "type": "object", "properties": { "item_id": { - "type": "string" + "type": "string", + "description": "Unique identifier of the MCP call" }, "output_index": { - "type": "integer" + "type": "integer", + "description": "Index position of the item in the output list" }, "sequence_number": { - "type": "integer" + "type": "integer", + "description": "Sequential number for ordering streaming events" }, "type": { "type": "string", "const": "response.mcp_call.in_progress", - "default": "response.mcp_call.in_progress" + "default": "response.mcp_call.in_progress", + "description": "Event type identifier, always \"response.mcp_call.in_progress\"" } }, "additionalProperties": false, @@ -8920,7 +9043,8 @@ "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseMcpCallInProgress" + "title": "OpenAIResponseObjectStreamResponseMcpCallInProgress", + "description": "Streaming event for MCP calls in progress." }, "OpenAIResponseObjectStreamResponseMcpListToolsCompleted": { "type": "object", @@ -8983,21 +9107,26 @@ "type": "object", "properties": { "response_id": { - "type": "string" + "type": "string", + "description": "Unique identifier of the response containing this output" }, "item": { - "$ref": "#/components/schemas/OpenAIResponseOutput" + "$ref": "#/components/schemas/OpenAIResponseOutput", + "description": "The output item that was added (message, tool call, etc.)" }, "output_index": { - "type": "integer" + "type": "integer", + "description": "Index position of this item in the output list" }, "sequence_number": { - "type": "integer" + "type": "integer", + "description": "Sequential number for ordering streaming events" }, "type": { "type": "string", "const": "response.output_item.added", - "default": "response.output_item.added" + "default": "response.output_item.added", + "description": "Event type identifier, always \"response.output_item.added\"" } }, "additionalProperties": false, @@ -9008,27 +9137,33 @@ "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseOutputItemAdded" + "title": "OpenAIResponseObjectStreamResponseOutputItemAdded", + "description": "Streaming event for when a new output item is added to the response." }, "OpenAIResponseObjectStreamResponseOutputItemDone": { "type": "object", "properties": { "response_id": { - "type": "string" + "type": "string", + "description": "Unique identifier of the response containing this output" }, "item": { - "$ref": "#/components/schemas/OpenAIResponseOutput" + "$ref": "#/components/schemas/OpenAIResponseOutput", + "description": "The completed output item (message, tool call, etc.)" }, "output_index": { - "type": "integer" + "type": "integer", + "description": "Index position of this item in the output list" }, "sequence_number": { - "type": "integer" + "type": "integer", + "description": "Sequential number for ordering streaming events" }, "type": { "type": "string", "const": "response.output_item.done", - "default": "response.output_item.done" + "default": "response.output_item.done", + "description": "Event type identifier, always \"response.output_item.done\"" } }, "additionalProperties": false, @@ -9039,30 +9174,37 @@ "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseOutputItemDone" + "title": "OpenAIResponseObjectStreamResponseOutputItemDone", + "description": "Streaming event for when an output item is completed." }, "OpenAIResponseObjectStreamResponseOutputTextDelta": { "type": "object", "properties": { "content_index": { - "type": "integer" + "type": "integer", + "description": "Index position within the text content" }, "delta": { - "type": "string" + "type": "string", + "description": "Incremental text content being added" }, "item_id": { - "type": "string" + "type": "string", + "description": "Unique identifier of the output item being updated" }, "output_index": { - "type": "integer" + "type": "integer", + "description": "Index position of the item in the output list" }, "sequence_number": { - "type": "integer" + "type": "integer", + "description": "Sequential number for ordering streaming events" }, "type": { "type": "string", "const": "response.output_text.delta", - "default": "response.output_text.delta" + "default": "response.output_text.delta", + "description": "Event type identifier, always \"response.output_text.delta\"" } }, "additionalProperties": false, @@ -9074,30 +9216,37 @@ "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseOutputTextDelta" + "title": "OpenAIResponseObjectStreamResponseOutputTextDelta", + "description": "Streaming event for incremental text content updates." }, "OpenAIResponseObjectStreamResponseOutputTextDone": { "type": "object", "properties": { "content_index": { - "type": "integer" + "type": "integer", + "description": "Index position within the text content" }, "text": { - "type": "string" + "type": "string", + "description": "Final complete text content of the output item" }, "item_id": { - "type": "string" + "type": "string", + "description": "Unique identifier of the completed output item" }, "output_index": { - "type": "integer" + "type": "integer", + "description": "Index position of the item in the output list" }, "sequence_number": { - "type": "integer" + "type": "integer", + "description": "Sequential number for ordering streaming events" }, "type": { "type": "string", "const": "response.output_text.done", - "default": "response.output_text.done" + "default": "response.output_text.done", + "description": "Event type identifier, always \"response.output_text.done\"" } }, "additionalProperties": false, @@ -9109,24 +9258,29 @@ "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseOutputTextDone" + "title": "OpenAIResponseObjectStreamResponseOutputTextDone", + "description": "Streaming event for when text output is completed." }, "OpenAIResponseObjectStreamResponseWebSearchCallCompleted": { "type": "object", "properties": { "item_id": { - "type": "string" + "type": "string", + "description": "Unique identifier of the completed web search call" }, "output_index": { - "type": "integer" + "type": "integer", + "description": "Index position of the item in the output list" }, "sequence_number": { - "type": "integer" + "type": "integer", + "description": "Sequential number for ordering streaming events" }, "type": { "type": "string", "const": "response.web_search_call.completed", - "default": "response.web_search_call.completed" + "default": "response.web_search_call.completed", + "description": "Event type identifier, always \"response.web_search_call.completed\"" } }, "additionalProperties": false, @@ -9136,24 +9290,29 @@ "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseWebSearchCallCompleted" + "title": "OpenAIResponseObjectStreamResponseWebSearchCallCompleted", + "description": "Streaming event for completed web search calls." }, "OpenAIResponseObjectStreamResponseWebSearchCallInProgress": { "type": "object", "properties": { "item_id": { - "type": "string" + "type": "string", + "description": "Unique identifier of the web search call" }, "output_index": { - "type": "integer" + "type": "integer", + "description": "Index position of the item in the output list" }, "sequence_number": { - "type": "integer" + "type": "integer", + "description": "Sequential number for ordering streaming events" }, "type": { "type": "string", "const": "response.web_search_call.in_progress", - "default": "response.web_search_call.in_progress" + "default": "response.web_search_call.in_progress", + "description": "Event type identifier, always \"response.web_search_call.in_progress\"" } }, "additionalProperties": false, @@ -9163,7 +9322,8 @@ "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseWebSearchCallInProgress" + "title": "OpenAIResponseObjectStreamResponseWebSearchCallInProgress", + "description": "Streaming event for web search calls in progress." }, "OpenAIResponseObjectStreamResponseWebSearchCallSearching": { "type": "object", @@ -9196,16 +9356,19 @@ "type": "object", "properties": { "id": { - "type": "string" + "type": "string", + "description": "Unique identifier of the deleted response" }, "object": { "type": "string", "const": "response", - "default": "response" + "default": "response", + "description": "Object type identifier, always \"response\"" }, "deleted": { "type": "boolean", - "default": true + "default": true, + "description": "Deletion confirmation flag, always True" } }, "additionalProperties": false, @@ -9214,7 +9377,8 @@ "object", "deleted" ], - "title": "OpenAIDeleteResponseObject" + "title": "OpenAIDeleteResponseObject", + "description": "Response object confirming deletion of an OpenAI response." }, "EmbeddingsRequest": { "type": "object", @@ -12146,12 +12310,14 @@ "type": "array", "items": { "$ref": "#/components/schemas/OpenAIResponseInput" - } + }, + "description": "List of input items" }, "object": { "type": "string", "const": "list", - "default": "list" + "default": "list", + "description": "Object type identifier, always \"list\"" } }, "additionalProperties": false, @@ -12159,7 +12325,8 @@ "data", "object" ], - "title": "ListOpenAIResponseInputItem" + "title": "ListOpenAIResponseInputItem", + "description": "List container for OpenAI response input items." }, "ListOpenAIResponseObject": { "type": "object", @@ -12168,21 +12335,26 @@ "type": "array", "items": { "$ref": "#/components/schemas/OpenAIResponseObjectWithInput" - } + }, + "description": "List of response objects with their input context" }, "has_more": { - "type": "boolean" + "type": "boolean", + "description": "Whether there are more results available beyond this page" }, "first_id": { - "type": "string" + "type": "string", + "description": "Identifier of the first item in this page" }, "last_id": { - "type": "string" + "type": "string", + "description": "Identifier of the last item in this page" }, "object": { "type": "string", "const": "list", - "default": "list" + "default": "list", + "description": "Object type identifier, always \"list\"" } }, "additionalProperties": false, @@ -12193,64 +12365,80 @@ "last_id", "object" ], - "title": "ListOpenAIResponseObject" + "title": "ListOpenAIResponseObject", + "description": "Paginated list of OpenAI response objects with navigation metadata." }, "OpenAIResponseObjectWithInput": { "type": "object", "properties": { "created_at": { - "type": "integer" + "type": "integer", + "description": "Unix timestamp when the response was created" }, "error": { - "$ref": "#/components/schemas/OpenAIResponseError" + "$ref": "#/components/schemas/OpenAIResponseError", + "description": "(Optional) Error details if the response generation failed" }, "id": { - "type": "string" + "type": "string", + "description": "Unique identifier for this response" }, "model": { - "type": "string" + "type": "string", + "description": "Model identifier used for generation" }, "object": { "type": "string", "const": "response", - "default": "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 + "default": false, + "description": "Whether tool calls can be executed in parallel" }, "previous_response_id": { - "type": "string" + "type": "string", + "description": "(Optional) ID of the previous response in a conversation" }, "status": { - "type": "string" + "type": "string", + "description": "Current status of the response generation" }, "temperature": { - "type": "number" + "type": "number", + "description": "(Optional) Sampling temperature used for generation" }, "text": { - "$ref": "#/components/schemas/OpenAIResponseText" + "$ref": "#/components/schemas/OpenAIResponseText", + "description": "Text formatting configuration for the response" }, "top_p": { - "type": "number" + "type": "number", + "description": "(Optional) Nucleus sampling parameter used for generation" }, "truncation": { - "type": "string" + "type": "string", + "description": "(Optional) Truncation strategy applied to the response" }, "user": { - "type": "string" + "type": "string", + "description": "(Optional) User identifier associated with the request" }, "input": { "type": "array", "items": { "$ref": "#/components/schemas/OpenAIResponseInput" - } + }, + "description": "List of input items that led to this response" } }, "additionalProperties": false, @@ -12265,7 +12453,8 @@ "text", "input" ], - "title": "OpenAIResponseObjectWithInput" + "title": "OpenAIResponseObjectWithInput", + "description": "OpenAI response object extended with input context information." }, "ListProvidersResponse": { "type": "object", diff --git a/docs/_static/llama-stack-spec.yaml b/docs/_static/llama-stack-spec.yaml index ea306f120..54bddd235 100644 --- a/docs/_static/llama-stack-spec.yaml +++ b/docs/_static/llama-stack-spec.yaml @@ -5470,14 +5470,22 @@ components: type: string const: url_citation default: url_citation + description: >- + Annotation type identifier, always "url_citation" end_index: type: integer + description: >- + End position of the citation span in the content start_index: type: integer + description: >- + Start position of the citation span in the content title: type: string + description: Title of the referenced web resource url: type: string + description: URL of the referenced web resource additionalProperties: false required: - type @@ -5486,6 +5494,8 @@ components: - title - url title: OpenAIResponseAnnotationCitation + description: >- + URL citation annotation for referencing external web resources. "OpenAIResponseAnnotationContainerFileCitation": type: object properties: @@ -5520,12 +5530,18 @@ components: 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 @@ -5533,6 +5549,8 @@ components: - filename - index title: OpenAIResponseAnnotationFileCitation + description: >- + File citation annotation for referencing specific files in response content. OpenAIResponseAnnotationFilePath: type: object properties: @@ -5616,31 +5634,43 @@ components: - 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" image_url: type: string + description: (Optional) URL of the image content additionalProperties: false required: - detail - type title: OpenAIResponseInputMessageContentImage + description: >- + Image content for input messages in OpenAI response format. OpenAIResponseInputMessageContentText: type: object properties: text: type: string + description: The text content of the input message type: type: string const: input_text default: input_text + description: >- + Content type identifier, always "input_text" additionalProperties: false required: - text - type title: OpenAIResponseInputMessageContentText + description: >- + Text content for input messages in OpenAI response format. OpenAIResponseInputTool: oneOf: - $ref: '#/components/schemas/OpenAIResponseInputToolWebSearch' @@ -5661,10 +5691,14 @@ components: 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: @@ -5675,9 +5709,13 @@ components: - 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: @@ -5691,14 +5729,15 @@ components: description: >- (Optional) Minimum relevance score threshold for results additionalProperties: false - title: SearchRankingOptions description: >- - Options for ranking and filtering search results. + (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: @@ -5706,10 +5745,14 @@ components: 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: @@ -5720,13 +5763,19 @@ components: - 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. OpenAIResponseInputToolMCP: type: object properties: @@ -5734,10 +5783,13 @@ components: 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: @@ -5748,6 +5800,8 @@ components: - type: string - type: array - type: object + description: >- + (Optional) HTTP headers to include when connecting to the server require_approval: oneOf: - type: string @@ -5760,13 +5814,21 @@ components: 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 @@ -5778,8 +5840,14 @@ components: 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 @@ -5787,6 +5855,8 @@ components: - server_url - require_approval title: OpenAIResponseInputToolMCP + description: >- + Model Context Protocol (MCP) tool configuration for OpenAI response inputs. OpenAIResponseInputToolWebSearch: type: object properties: @@ -5799,13 +5869,18 @@ components: - 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. OpenAIResponseMessage: type: object properties: @@ -5871,16 +5946,22 @@ components: properties: id: type: string + description: Unique identifier for this tool call queries: type: array items: type: string + description: List of search queries executed status: type: string + description: >- + Current status of the file search operation type: type: string const: file_search_call default: file_search_call + description: >- + Tool call type identifier, always "file_search_call" results: type: array items: @@ -5893,6 +5974,8 @@ components: - type: string - type: array - type: object + description: >- + (Optional) Search results returned by the file search operation additionalProperties: false required: - id @@ -5901,23 +5984,35 @@ components: - type title: >- OpenAIResponseOutputMessageFileSearchToolCall + description: >- + File search tool call output message for OpenAI responses. "OpenAIResponseOutputMessageFunctionToolCall": type: object properties: call_id: type: string + description: Unique identifier for the function call name: type: string + description: Name of the function being called arguments: type: string + description: >- + JSON string containing the function arguments type: type: string const: function_call default: function_call + description: >- + Tool call type identifier, always "function_call" id: type: string + description: >- + (Optional) Additional identifier for the tool call status: type: string + description: >- + (Optional) Current status of the function call execution additionalProperties: false required: - call_id @@ -5926,17 +6021,24 @@ components: - type title: >- OpenAIResponseOutputMessageFunctionToolCall + description: >- + Function tool call output message for OpenAI responses. "OpenAIResponseOutputMessageWebSearchToolCall": type: object properties: id: type: string + description: Unique identifier for this tool call status: type: string + description: >- + Current status of the web search operation type: type: string const: web_search_call default: web_search_call + description: >- + Tool call type identifier, always "web_search_call" additionalProperties: false required: - id @@ -5944,6 +6046,8 @@ components: - type title: >- OpenAIResponseOutputMessageWebSearchToolCall + description: >- + Web search tool call output message for OpenAI responses. OpenAIResponseText: type: object properties: @@ -5990,11 +6094,12 @@ components: additionalProperties: false required: - type - title: OpenAIResponseTextFormat description: >- - Configuration for Responses API text format. + (Optional) Text format configuration specifying output format requirements additionalProperties: false title: OpenAIResponseText + description: >- + Text response configuration for OpenAI responses. CreateOpenaiResponseRequest: type: object properties: @@ -6040,49 +6145,81 @@ components: 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. 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 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 truncation: type: string + description: >- + (Optional) Truncation strategy applied to the response user: type: string + description: >- + (Optional) User identifier associated with the request additionalProperties: false required: - created_at @@ -6094,6 +6231,8 @@ components: - status - text title: OpenAIResponseObject + description: >- + Complete OpenAI response object containing generation results and metadata. OpenAIResponseOutput: oneOf: - $ref: '#/components/schemas/OpenAIResponseMessage' @@ -6116,20 +6255,32 @@ components: 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 @@ -6138,17 +6289,25 @@ components: - name - server_label title: OpenAIResponseOutputMessageMCPCall + description: >- + Model Context Protocol (MCP) call output message for OpenAI responses. OpenAIResponseOutputMessageMCPListTools: type: object properties: id: type: string + description: >- + Unique identifier for this MCP list tools operation type: type: string const: mcp_list_tools default: mcp_list_tools + description: >- + Tool call type identifier, always "mcp_list_tools" server_label: type: string + description: >- + Label identifying the MCP server providing the tools tools: type: array items: @@ -6164,15 +6323,24 @@ components: - 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 @@ -6180,6 +6348,8 @@ components: - server_label - tools title: OpenAIResponseOutputMessageMCPListTools + description: >- + MCP list tools output message containing available tools from an MCP server. OpenAIResponseObjectStream: oneOf: - $ref: '#/components/schemas/OpenAIResponseObjectStreamResponseCreated' @@ -6228,46 +6398,66 @@ components: properties: response: $ref: '#/components/schemas/OpenAIResponseObject' + description: The 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. "OpenAIResponseObjectStreamResponseCreated": type: object properties: response: $ref: '#/components/schemas/OpenAIResponseObject' + description: The newly created response object 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. "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 @@ -6277,21 +6467,33 @@ components: - 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 @@ -6301,6 +6503,8 @@ components: - type title: >- OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone + description: >- + Streaming event for when function call arguments are completed. "OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta": type: object properties: @@ -6354,44 +6558,61 @@ components: 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": type: object properties: sequence_number: type: integer + description: >- + Sequential number for ordering streaming events type: type: string const: response.mcp_call.failed default: response.mcp_call.failed + 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 + description: >- + Index position of the item in the output list sequence_number: type: integer + description: >- + Sequential number for ordering streaming events type: type: string const: response.mcp_call.in_progress default: response.mcp_call.in_progress + description: >- + Event type identifier, always "response.mcp_call.in_progress" additionalProperties: false required: - item_id @@ -6400,6 +6621,8 @@ components: - type title: >- OpenAIResponseObjectStreamResponseMcpCallInProgress + description: >- + Streaming event for MCP calls in progress. "OpenAIResponseObjectStreamResponseMcpListToolsCompleted": type: object properties: @@ -6450,16 +6673,26 @@ components: properties: response_id: type: string + description: >- + Unique identifier of the response containing this output item: $ref: '#/components/schemas/OpenAIResponseOutput' + 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 @@ -6469,21 +6702,33 @@ components: - 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: $ref: '#/components/schemas/OpenAIResponseOutput' + 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 @@ -6493,23 +6738,35 @@ components: - type title: >- OpenAIResponseObjectStreamResponseOutputItemDone + description: >- + Streaming event for when an output item is completed. "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 @@ -6520,23 +6777,36 @@ components: - 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: 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 @@ -6547,19 +6817,29 @@ components: - type title: >- OpenAIResponseObjectStreamResponseOutputTextDone + description: >- + Streaming event for when text output 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: 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 @@ -6568,19 +6848,28 @@ components: - type title: >- OpenAIResponseObjectStreamResponseWebSearchCallCompleted + description: >- + Streaming event for completed web search calls. "OpenAIResponseObjectStreamResponseWebSearchCallInProgress": type: object properties: item_id: type: string + description: Unique identifier of the web search call output_index: type: integer + description: >- + Index position of the item in the output list sequence_number: type: integer + description: >- + Sequential number for ordering streaming events type: type: string const: response.web_search_call.in_progress default: response.web_search_call.in_progress + description: >- + Event type identifier, always "response.web_search_call.in_progress" additionalProperties: false required: - item_id @@ -6589,6 +6878,8 @@ components: - type title: >- OpenAIResponseObjectStreamResponseWebSearchCallInProgress + description: >- + Streaming event for web search calls in progress. "OpenAIResponseObjectStreamResponseWebSearchCallSearching": type: object properties: @@ -6615,19 +6906,26 @@ components: properties: id: type: string + description: >- + Unique identifier of the deleted response object: type: string const: response default: response + description: >- + Object type identifier, always "response" deleted: type: boolean default: true + description: Deletion confirmation flag, always True additionalProperties: false required: - id - object - deleted title: OpenAIDeleteResponseObject + description: >- + Response object confirming deletion of an OpenAI response. EmbeddingsRequest: type: object properties: @@ -8815,15 +9113,19 @@ components: 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. ListOpenAIResponseObject: type: object properties: @@ -8831,16 +9133,24 @@ components: 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 @@ -8849,46 +9159,76 @@ components: - last_id - object title: ListOpenAIResponseObject + description: >- + Paginated list of OpenAI response objects with navigation metadata. 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 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 truncation: type: string + description: >- + (Optional) Truncation strategy applied to the response user: type: string + description: >- + (Optional) User identifier associated with the request input: type: array items: $ref: '#/components/schemas/OpenAIResponseInput' + description: >- + List of input items that led to this response additionalProperties: false required: - created_at @@ -8901,6 +9241,8 @@ components: - text - input title: OpenAIResponseObjectWithInput + description: >- + OpenAI response object extended with input context information. ListProvidersResponse: type: object properties: diff --git a/llama_stack/apis/agents/openai_responses.py b/llama_stack/apis/agents/openai_responses.py index 10843a3fe..6587a706e 100644 --- a/llama_stack/apis/agents/openai_responses.py +++ b/llama_stack/apis/agents/openai_responses.py @@ -18,18 +18,34 @@ from llama_stack.schema_utils import json_schema_type, register_schema @json_schema_type class OpenAIResponseError(BaseModel): + """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 + """ code: str message: str @json_schema_type class OpenAIResponseInputMessageContentText(BaseModel): + """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" + """ text: str type: Literal["input_text"] = "input_text" @json_schema_type class OpenAIResponseInputMessageContentImage(BaseModel): + """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 + """ detail: Literal["low"] | Literal["high"] | Literal["auto"] = "auto" type: Literal["input_image"] = "input_image" # TODO: handle file_id @@ -46,6 +62,13 @@ register_schema(OpenAIResponseInputMessageContent, name="OpenAIResponseInputMess @json_schema_type class OpenAIResponseAnnotationFileCitation(BaseModel): + """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 + """ type: Literal["file_citation"] = "file_citation" file_id: str filename: str @@ -54,6 +77,14 @@ class OpenAIResponseAnnotationFileCitation(BaseModel): @json_schema_type class OpenAIResponseAnnotationCitation(BaseModel): + """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 + """ type: Literal["url_citation"] = "url_citation" end_index: int start_index: int @@ -122,6 +153,12 @@ class OpenAIResponseMessage(BaseModel): @json_schema_type class OpenAIResponseOutputMessageWebSearchToolCall(BaseModel): + """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" + """ id: str status: str type: Literal["web_search_call"] = "web_search_call" @@ -129,6 +166,14 @@ class OpenAIResponseOutputMessageWebSearchToolCall(BaseModel): @json_schema_type class OpenAIResponseOutputMessageFileSearchToolCall(BaseModel): + """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 + """ id: str queries: list[str] status: str @@ -138,6 +183,15 @@ class OpenAIResponseOutputMessageFileSearchToolCall(BaseModel): @json_schema_type class OpenAIResponseOutputMessageFunctionToolCall(BaseModel): + """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 + """ call_id: str name: str arguments: str @@ -148,6 +202,16 @@ class OpenAIResponseOutputMessageFunctionToolCall(BaseModel): @json_schema_type class OpenAIResponseOutputMessageMCPCall(BaseModel): + """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 + """ id: str type: Literal["mcp_call"] = "mcp_call" arguments: str @@ -158,6 +222,12 @@ class OpenAIResponseOutputMessageMCPCall(BaseModel): class MCPListToolsTool(BaseModel): + """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 + """ input_schema: dict[str, Any] name: str description: str | None = None @@ -165,6 +235,13 @@ class MCPListToolsTool(BaseModel): @json_schema_type class OpenAIResponseOutputMessageMCPListTools(BaseModel): + """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 + """ id: str type: Literal["mcp_list_tools"] = "mcp_list_tools" server_label: str @@ -206,11 +283,32 @@ class OpenAIResponseTextFormat(TypedDict, total=False): @json_schema_type class OpenAIResponseText(BaseModel): + """Text response configuration for OpenAI responses. + + :param format: (Optional) Text format configuration specifying output format requirements + """ format: OpenAIResponseTextFormat | None = None @json_schema_type class OpenAIResponseObject(BaseModel): + """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 truncation: (Optional) Truncation strategy applied to the response + :param user: (Optional) User identifier associated with the request + """ created_at: int error: OpenAIResponseError | None = None id: str @@ -231,6 +329,12 @@ class OpenAIResponseObject(BaseModel): @json_schema_type class OpenAIDeleteResponseObject(BaseModel): + """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 + """ id: str object: Literal["response"] = "response" deleted: bool = True @@ -238,18 +342,36 @@ class OpenAIDeleteResponseObject(BaseModel): @json_schema_type class OpenAIResponseObjectStreamResponseCreated(BaseModel): + """Streaming event indicating a new response has been created. + + :param response: The newly created response object + :param type: Event type identifier, always "response.created" + """ response: OpenAIResponseObject type: Literal["response.created"] = "response.created" @json_schema_type class OpenAIResponseObjectStreamResponseCompleted(BaseModel): + """Streaming event indicating a response has been completed. + + :param response: The completed response object + :param type: Event type identifier, always "response.completed" + """ response: OpenAIResponseObject type: Literal["response.completed"] = "response.completed" @json_schema_type class OpenAIResponseObjectStreamResponseOutputItemAdded(BaseModel): + """Streaming event for when a new output item is added to the response. + + :param response_id: Unique identifier of the response containing this output + :param item: The output item that was added (message, tool call, etc.) + :param output_index: Index position of this item in the output list + :param sequence_number: Sequential number for ordering streaming events + :param type: Event type identifier, always "response.output_item.added" + """ response_id: str item: OpenAIResponseOutput output_index: int @@ -259,6 +381,14 @@ class OpenAIResponseObjectStreamResponseOutputItemAdded(BaseModel): @json_schema_type class OpenAIResponseObjectStreamResponseOutputItemDone(BaseModel): + """Streaming event for when an output item is completed. + + :param response_id: Unique identifier of the response containing this output + :param item: The completed output item (message, tool call, etc.) + :param output_index: Index position of this item in the output list + :param sequence_number: Sequential number for ordering streaming events + :param type: Event type identifier, always "response.output_item.done" + """ response_id: str item: OpenAIResponseOutput output_index: int @@ -268,6 +398,15 @@ class OpenAIResponseObjectStreamResponseOutputItemDone(BaseModel): @json_schema_type class OpenAIResponseObjectStreamResponseOutputTextDelta(BaseModel): + """Streaming event for incremental text content updates. + + :param content_index: Index position within the text content + :param delta: Incremental text content being added + :param item_id: Unique identifier of the output item being updated + :param output_index: Index position of the item in the output list + :param sequence_number: Sequential number for ordering streaming events + :param type: Event type identifier, always "response.output_text.delta" + """ content_index: int delta: str item_id: str @@ -278,6 +417,15 @@ class OpenAIResponseObjectStreamResponseOutputTextDelta(BaseModel): @json_schema_type class OpenAIResponseObjectStreamResponseOutputTextDone(BaseModel): + """Streaming event for when text output is completed. + + :param content_index: Index position within the text content + :param text: Final complete text content of the output item + :param item_id: Unique identifier of the completed output item + :param output_index: Index position of the item in the output list + :param sequence_number: Sequential number for ordering streaming events + :param type: Event type identifier, always "response.output_text.done" + """ content_index: int text: str # final text of the output item item_id: str @@ -288,6 +436,14 @@ class OpenAIResponseObjectStreamResponseOutputTextDone(BaseModel): @json_schema_type class OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta(BaseModel): + """Streaming event for incremental function call argument updates. + + :param delta: Incremental function call arguments being added + :param item_id: Unique identifier of the function call being updated + :param output_index: Index position of the item in the output list + :param sequence_number: Sequential number for ordering streaming events + :param type: Event type identifier, always "response.function_call_arguments.delta" + """ delta: str item_id: str output_index: int @@ -297,6 +453,14 @@ class OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta(BaseModel): @json_schema_type class OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone(BaseModel): + """Streaming event for when function call arguments are completed. + + :param arguments: Final complete arguments JSON string for the function call + :param item_id: Unique identifier of the completed function call + :param output_index: Index position of the item in the output list + :param sequence_number: Sequential number for ordering streaming events + :param type: Event type identifier, always "response.function_call_arguments.done" + """ arguments: str # final arguments of the function call item_id: str output_index: int @@ -306,6 +470,13 @@ class OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone(BaseModel): @json_schema_type class OpenAIResponseObjectStreamResponseWebSearchCallInProgress(BaseModel): + """Streaming event for web search calls in progress. + + :param item_id: Unique identifier of the web search call + :param output_index: Index position of the item in the output list + :param sequence_number: Sequential number for ordering streaming events + :param type: Event type identifier, always "response.web_search_call.in_progress" + """ item_id: str output_index: int sequence_number: int @@ -322,6 +493,13 @@ class OpenAIResponseObjectStreamResponseWebSearchCallSearching(BaseModel): @json_schema_type class OpenAIResponseObjectStreamResponseWebSearchCallCompleted(BaseModel): + """Streaming event for completed web search calls. + + :param item_id: Unique identifier of the completed web search call + :param output_index: Index position of the item in the output list + :param sequence_number: Sequential number for ordering streaming events + :param type: Event type identifier, always "response.web_search_call.completed" + """ item_id: str output_index: int sequence_number: int @@ -366,6 +544,13 @@ class OpenAIResponseObjectStreamResponseMcpCallArgumentsDone(BaseModel): @json_schema_type class OpenAIResponseObjectStreamResponseMcpCallInProgress(BaseModel): + """Streaming event for MCP calls in progress. + + :param item_id: Unique identifier of the MCP call + :param output_index: Index position of the item in the output list + :param sequence_number: Sequential number for ordering streaming events + :param type: Event type identifier, always "response.mcp_call.in_progress" + """ item_id: str output_index: int sequence_number: int @@ -374,12 +559,22 @@ class OpenAIResponseObjectStreamResponseMcpCallInProgress(BaseModel): @json_schema_type class OpenAIResponseObjectStreamResponseMcpCallFailed(BaseModel): + """Streaming event for failed MCP calls. + + :param sequence_number: Sequential number for ordering streaming events + :param type: Event type identifier, always "response.mcp_call.failed" + """ sequence_number: int type: Literal["response.mcp_call.failed"] = "response.mcp_call.failed" @json_schema_type class OpenAIResponseObjectStreamResponseMcpCallCompleted(BaseModel): + """Streaming event for completed MCP calls. + + :param sequence_number: Sequential number for ordering streaming events + :param type: Event type identifier, always "response.mcp_call.completed" + """ sequence_number: int type: Literal["response.mcp_call.completed"] = "response.mcp_call.completed" @@ -442,6 +637,11 @@ WebSearchToolTypes = ["web_search", "web_search_preview", "web_search_preview_20 @json_schema_type class OpenAIResponseInputToolWebSearch(BaseModel): + """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" + """ # Must match values of WebSearchToolTypes above type: Literal["web_search"] | Literal["web_search_preview"] | Literal["web_search_preview_2025_03_11"] = ( "web_search" @@ -453,6 +653,14 @@ class OpenAIResponseInputToolWebSearch(BaseModel): @json_schema_type class OpenAIResponseInputToolFunction(BaseModel): + """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 + """ type: Literal["function"] = "function" name: str description: str | None = None @@ -462,6 +670,14 @@ class OpenAIResponseInputToolFunction(BaseModel): @json_schema_type class OpenAIResponseInputToolFileSearch(BaseModel): + """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 + """ type: Literal["file_search"] = "file_search" vector_store_ids: list[str] filters: dict[str, Any] | None = None @@ -470,16 +686,34 @@ class OpenAIResponseInputToolFileSearch(BaseModel): class ApprovalFilter(BaseModel): + """Filter configuration for MCP tool approval requirements. + + :param always: (Optional) List of tool names that always require approval + :param never: (Optional) List of tool names that never require approval + """ always: list[str] | None = None never: list[str] | None = None class AllowedToolsFilter(BaseModel): + """Filter configuration for restricting which MCP tools can be used. + + :param tool_names: (Optional) List of specific tool names that are allowed + """ tool_names: list[str] | None = None @json_schema_type class OpenAIResponseInputToolMCP(BaseModel): + """Model Context Protocol (MCP) tool configuration for OpenAI response inputs. + + :param type: Tool type identifier, always "mcp" + :param server_label: Label to identify this MCP server + :param server_url: URL endpoint of the MCP server + :param headers: (Optional) HTTP headers to include when connecting to the server + :param require_approval: Approval requirement for tool calls ("always", "never", or filter) + :param allowed_tools: (Optional) Restriction on which tools can be used from this server + """ type: Literal["mcp"] = "mcp" server_label: str server_url: str @@ -500,17 +734,34 @@ register_schema(OpenAIResponseInputTool, name="OpenAIResponseInputTool") class ListOpenAIResponseInputItem(BaseModel): + """List container for OpenAI response input items. + + :param data: List of input items + :param object: Object type identifier, always "list" + """ data: list[OpenAIResponseInput] object: Literal["list"] = "list" @json_schema_type class OpenAIResponseObjectWithInput(OpenAIResponseObject): + """OpenAI response object extended with input context information. + + :param input: List of input items that led to this response + """ input: list[OpenAIResponseInput] @json_schema_type class ListOpenAIResponseObject(BaseModel): + """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" + """ data: list[OpenAIResponseObjectWithInput] has_more: bool first_id: str diff --git a/scratch.md b/scratch.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/todos.md b/todos.md deleted file mode 100644 index e69de29bb..000000000