From 654b119e2872af4a8ef6d2760bbf251ec172c465 Mon Sep 17 00:00:00 2001 From: Eric Huang Date: Tue, 14 Oct 2025 13:36:33 -0700 Subject: [PATCH] chore!: remove ALL telemetry APIs # What does this PR do? ## Test Plan --- docs/static/deprecated-llama-stack-spec.html | 5791 +++++++--------- docs/static/deprecated-llama-stack-spec.yaml | 663 -- .../static/experimental-llama-stack-spec.html | 6049 +++++++---------- .../static/experimental-llama-stack-spec.yaml | 663 -- docs/static/llama-stack-spec.html | 391 -- docs/static/llama-stack-spec.yaml | 291 - docs/static/stainless-llama-stack-spec.html | 4718 +++++-------- docs/static/stainless-llama-stack-spec.yaml | 980 +-- llama_stack/apis/telemetry/telemetry.py | 76 +- ...e8083caf34f49147ad1c25efae1de3f0b25e5.json | 57 - .../telemetry/test_openai_telemetry.py | 194 - tests/integration/telemetry/test_telemetry.py | 187 - .../telemetry/test_telemetry_metrics.py | 206 - 13 files changed, 6765 insertions(+), 13501 deletions(-) delete mode 100644 tests/integration/telemetry/recordings/0de60cd6a6ec3dbfc4a7601e77be8083caf34f49147ad1c25efae1de3f0b25e5.json delete mode 100644 tests/integration/telemetry/test_openai_telemetry.py delete mode 100644 tests/integration/telemetry/test_telemetry.py delete mode 100644 tests/integration/telemetry/test_telemetry_metrics.py diff --git a/docs/static/deprecated-llama-stack-spec.html b/docs/static/deprecated-llama-stack-spec.html index 46417522cc..0fa8c9adc6 100644 --- a/docs/static/deprecated-llama-stack-spec.html +++ b/docs/static/deprecated-llama-stack-spec.html @@ -3526,627 +3526,290 @@ }, "deprecated": true } - }, - "/v1/telemetry/metrics/{metric_name}": { - "post": { - "responses": { - "200": { - "description": "A QueryMetricsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryMetricsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" + } + }, + "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema", + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" + "title": { + "type": "string", + "description": "Error title, a short summary of the error which is invariant for an error type" }, - "500": { - "$ref": "#/components/responses/InternalServerError500" + "detail": { + "type": "string", + "description": "Error detail, a longer human-readable description of the error" }, - "default": { - "$ref": "#/components/responses/DefaultError" + "instance": { + "type": "string", + "description": "(Optional) A URL which can be used to retrieve more information about the specific occurrence of the error" } }, - "tags": [ - "Telemetry" - ], - "summary": "Query metrics.", - "description": "Query metrics.", - "parameters": [ - { - "name": "metric_name", - "in": "path", - "description": "The name of the metric to query.", - "required": true, - "schema": { - "type": "string" - } - } + "additionalProperties": false, + "required": [ + "status", + "title", + "detail" ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryMetricsRequest" - } - } - }, - "required": true - }, - "deprecated": true - } - }, - "/v1/telemetry/spans": { - "post": { - "responses": { - "200": { - "description": "A QuerySpansResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QuerySpansResponse" - } + "title": "Error", + "description": "Error response from the API. Roughly follows RFC 7807." + }, + "PaginatedResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" + }, + "description": "The list of items for the current page" }, - "500": { - "$ref": "#/components/responses/InternalServerError500" + "has_more": { + "type": "boolean", + "description": "Whether there are more items available after this set" }, - "default": { - "$ref": "#/components/responses/DefaultError" + "url": { + "type": "string", + "description": "The URL for accessing this list" } }, - "tags": [ - "Telemetry" + "additionalProperties": false, + "required": [ + "data", + "has_more" ], - "summary": "Query spans.", - "description": "Query spans.", - "parameters": [], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QuerySpansRequest" - } + "title": "PaginatedResponse", + "description": "A generic paginated response that follows a simple format." + }, + "AgentConfig": { + "type": "object", + "properties": { + "sampling_params": { + "$ref": "#/components/schemas/SamplingParams" + }, + "input_shields": { + "type": "array", + "items": { + "type": "string" } }, - "required": true - }, - "deprecated": true - } - }, - "/v1/telemetry/spans/export": { - "post": { - "responses": { - "200": { - "description": "OK" + "output_shields": { + "type": "array", + "items": { + "type": "string" + } }, - "400": { - "$ref": "#/components/responses/BadRequest400" + "toolgroups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AgentTool" + } }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" + "client_tools": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ToolDef" + } }, - "500": { - "$ref": "#/components/responses/InternalServerError500" + "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 }, - "default": { - "$ref": "#/components/responses/DefaultError" - } - }, - "tags": [ - "Telemetry" - ], - "summary": "Save spans to a dataset.", - "description": "Save spans to a dataset.", - "parameters": [], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SaveSpansToDatasetRequest" - } - } + "tool_prompt_format": { + "type": "string", + "enum": [ + "json", + "function_tag", + "python_list" + ], + "title": "ToolPromptFormat", + "description": "Prompt format for calling custom / zero shot tools.", + "deprecated": true }, - "required": true - }, - "deprecated": true - } - }, - "/v1/telemetry/spans/{span_id}/tree": { - "post": { - "responses": { - "200": { - "description": "A QuerySpanTreeResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QuerySpanTreeResponse" - } - } - } + "tool_config": { + "$ref": "#/components/schemas/ToolConfig" }, - "400": { - "$ref": "#/components/responses/BadRequest400" + "max_infer_iters": { + "type": "integer", + "default": 10 }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" + "model": { + "type": "string", + "description": "The model identifier to use for the agent" }, - "500": { - "$ref": "#/components/responses/InternalServerError500" + "instructions": { + "type": "string", + "description": "The system instructions for the agent" }, - "default": { - "$ref": "#/components/responses/DefaultError" + "name": { + "type": "string", + "description": "Optional name for the agent, used in telemetry and identification" + }, + "enable_session_persistence": { + "type": "boolean", + "default": false, + "description": "Optional flag indicating whether session data has to be persisted" + }, + "response_format": { + "$ref": "#/components/schemas/ResponseFormat", + "description": "Optional response format configuration" } }, - "tags": [ - "Telemetry" + "additionalProperties": false, + "required": [ + "model", + "instructions" ], - "summary": "Get a span tree by its ID.", - "description": "Get a span tree by its ID.", - "parameters": [ + "title": "AgentConfig", + "description": "Configuration for an agent." + }, + "AgentTool": { + "oneOf": [ { - "name": "span_id", - "in": "path", - "description": "The ID of the span to get the tree from.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetSpanTreeRequest" - } - } + "type": "string" }, - "required": true - }, - "deprecated": true - } - }, - "/v1/telemetry/traces": { - "post": { - "responses": { - "200": { - "description": "A QueryTracesResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryTracesResponse" + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "args": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] } } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "$ref": "#/components/responses/DefaultError" + }, + "additionalProperties": false, + "required": [ + "name", + "args" + ], + "title": "AgentToolGroupWithArgs" } - }, - "tags": [ - "Telemetry" - ], - "summary": "Query traces.", - "description": "Query traces.", - "parameters": [], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryTracesRequest" - } - } - }, - "required": true - }, - "deprecated": true - } - }, - "/v1/telemetry/traces/{trace_id}": { - "get": { - "responses": { - "200": { - "description": "A Trace.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Trace" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" + ] + }, + "GrammarResponseFormat": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "json_schema", + "grammar" + ], + "description": "Must be \"grammar\" to identify this format type", + "const": "grammar", + "default": "grammar" }, - "default": { - "$ref": "#/components/responses/DefaultError" - } - }, - "tags": [ - "Telemetry" - ], - "summary": "Get a trace by its ID.", - "description": "Get a trace by its ID.", - "parameters": [ - { - "name": "trace_id", - "in": "path", - "description": "The ID of the trace to get.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "deprecated": true - } - }, - "/v1/telemetry/traces/{trace_id}/spans/{span_id}": { - "get": { - "responses": { - "200": { - "description": "A Span.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Span" + "bnf": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "$ref": "#/components/responses/DefaultError" + ] + }, + "description": "The BNF grammar specification the response should conform to" } }, - "tags": [ - "Telemetry" - ], - "summary": "Get a span by its ID.", - "description": "Get a span by its ID.", - "parameters": [ - { - "name": "trace_id", - "in": "path", - "description": "The ID of the trace to get the span from.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "span_id", - "in": "path", - "description": "The ID of the span to get.", - "required": true, - "schema": { - "type": "string" - } - } + "additionalProperties": false, + "required": [ + "type", + "bnf" ], - "deprecated": true - } - } - }, - "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema", - "components": { - "schemas": { - "Error": { + "title": "GrammarResponseFormat", + "description": "Configuration for grammar-guided response generation." + }, + "GreedySamplingStrategy": { "type": "object", "properties": { - "status": { - "type": "integer", - "description": "HTTP status code" - }, - "title": { - "type": "string", - "description": "Error title, a short summary of the error which is invariant for an error type" - }, - "detail": { - "type": "string", - "description": "Error detail, a longer human-readable description of the error" - }, - "instance": { + "type": { "type": "string", - "description": "(Optional) A URL which can be used to retrieve more information about the specific occurrence of the error" + "const": "greedy", + "default": "greedy", + "description": "Must be \"greedy\" to identify this sampling strategy" } }, "additionalProperties": false, "required": [ - "status", - "title", - "detail" + "type" ], - "title": "Error", - "description": "Error response from the API. Roughly follows RFC 7807." + "title": "GreedySamplingStrategy", + "description": "Greedy sampling strategy that selects the highest probability token at each step." }, - "PaginatedResponse": { - "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", - "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": { - "type": "string", - "description": "Optional name for the agent, used in telemetry and identification" - }, - "enable_session_persistence": { - "type": "boolean", - "default": false, - "description": "Optional flag indicating whether session data has to be persisted" - }, - "response_format": { - "$ref": "#/components/schemas/ResponseFormat", - "description": "Optional response format configuration" - } - }, - "additionalProperties": false, - "required": [ - "model", - "instructions" - ], - "title": "AgentConfig", - "description": "Configuration for an agent." - }, - "AgentTool": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "args": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - } - } - }, - "additionalProperties": false, - "required": [ - "name", - "args" - ], - "title": "AgentToolGroupWithArgs" - } - ] - }, - "GrammarResponseFormat": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "json_schema", - "grammar" - ], - "description": "Must be \"grammar\" to identify this format type", - "const": "grammar", - "default": "grammar" - }, - "bnf": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "The BNF grammar specification the response should conform to" - } - }, - "additionalProperties": false, - "required": [ - "type", - "bnf" - ], - "title": "GrammarResponseFormat", - "description": "Configuration for grammar-guided response generation." - }, - "GreedySamplingStrategy": { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "greedy", - "default": "greedy", - "description": "Must be \"greedy\" to identify this sampling strategy" - } - }, - "additionalProperties": false, - "required": [ - "type" - ], - "title": "GreedySamplingStrategy", - "description": "Greedy sampling strategy that selects the highest probability token at each step." - }, - "JsonSchemaResponseFormat": { + "JsonSchemaResponseFormat": { "type": "object", "properties": { "type": { @@ -10078,726 +9741,477 @@ "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" - }, - "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" - } - }, - "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." - }, - "OpenAIResponseContentPartRefusal": { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "refusal", - "default": "refusal", - "description": "Content part type identifier, always \"refusal\"" - }, - "refusal": { - "type": "string", - "description": "Refusal text supplied by the model" - } - }, - "additionalProperties": false, - "required": [ - "type", - "refusal" - ], - "title": "OpenAIResponseContentPartRefusal", - "description": "Refusal content within a streamed response part." - }, - "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": { + "previous_response_id": { "type": "string", - "const": "response.completed", - "default": "response.completed", - "description": "Event type identifier, always \"response.completed\"" + "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": [ - "response", - "type" + "input", + "model" ], - "title": "OpenAIResponseObjectStreamResponseCompleted", - "description": "Streaming event indicating a response has been completed." + "title": "CreateOpenaiResponseRequest" }, - "OpenAIResponseObjectStreamResponseContentPartAdded": { + "OpenAIResponseObject": { "type": "object", "properties": { - "content_index": { + "created_at": { "type": "integer", - "description": "Index position of the part within the content array" + "description": "Unix timestamp when the response was created" }, - "response_id": { + "error": { + "$ref": "#/components/schemas/OpenAIResponseError", + "description": "(Optional) Error details if the response generation failed" + }, + "id": { "type": "string", - "description": "Unique identifier of the response containing this content" + "description": "Unique identifier for this response" }, - "item_id": { + "model": { "type": "string", - "description": "Unique identifier of the output item containing this content part" + "description": "Model identifier used for generation" }, - "output_index": { - "type": "integer", - "description": "Index position of the output item in the response" + "object": { + "type": "string", + "const": "response", + "default": "response", + "description": "Object type identifier, always \"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" - } + "output": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAIResponseOutput" }, - "description": "The content part that was added" + "description": "List of generated output items (messages, tool calls, etc.)" }, - "sequence_number": { - "type": "integer", - "description": "Sequential number for ordering streaming events" + "parallel_tool_calls": { + "type": "boolean", + "default": false, + "description": "Whether tool calls can be executed in parallel" }, - "type": { + "previous_response_id": { "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" + "description": "(Optional) ID of the previous response in a conversation" }, - "response_id": { + "status": { "type": "string", - "description": "Unique identifier of the response containing this content" + "description": "Current status of the response generation" }, - "item_id": { - "type": "string", - "description": "Unique identifier of the output item containing this content part" + "temperature": { + "type": "number", + "description": "(Optional) Sampling temperature used for generation" }, - "output_index": { - "type": "integer", - "description": "Index position of the output item in the response" + "text": { + "$ref": "#/components/schemas/OpenAIResponseText", + "description": "Text formatting configuration for 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" + "top_p": { + "type": "number", + "description": "(Optional) Nucleus sampling parameter used for generation" }, - "sequence_number": { - "type": "integer", - "description": "Sequential number for ordering streaming events" + "tools": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAIResponseTool" + }, + "description": "(Optional) An array of tools the model may call while generating a response." }, - "type": { + "truncation": { "type": "string", - "const": "response.content_part.done", - "default": "response.content_part.done", - "description": "Event type identifier, always \"response.content_part.done\"" + "description": "(Optional) Truncation strategy applied to the response" + }, + "usage": { + "$ref": "#/components/schemas/OpenAIResponseUsage", + "description": "(Optional) Token usage information for the response" } }, "additionalProperties": false, "required": [ - "content_index", - "response_id", - "item_id", - "output_index", - "part", - "sequence_number", - "type" + "created_at", + "id", + "model", + "object", + "output", + "parallel_tool_calls", + "status", + "text" ], - "title": "OpenAIResponseObjectStreamResponseContentPartDone", - "description": "Streaming event for when a content part is completed." + "title": "OpenAIResponseObject", + "description": "Complete OpenAI response object containing generation results and metadata." }, - "OpenAIResponseObjectStreamResponseCreated": { + "OpenAIResponseContentPartOutputText": { "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\"" + "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": [ - "response", - "type" + "type", + "text", + "annotations" ], - "title": "OpenAIResponseObjectStreamResponseCreated", - "description": "Streaming event indicating a new response has been created." + "title": "OpenAIResponseContentPartOutputText", + "description": "Text content within a streamed response part." }, - "OpenAIResponseObjectStreamResponseFailed": { + "OpenAIResponseContentPartReasoningSummary": { "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\"" + "const": "summary_text", + "default": "summary_text", + "description": "Content part type identifier, always \"summary_text\"" + }, + "text": { + "type": "string", + "description": "Summary text" } }, "additionalProperties": false, "required": [ - "response", - "sequence_number", - "type" + "type", + "text" ], - "title": "OpenAIResponseObjectStreamResponseFailed", - "description": "Streaming event emitted when a response fails." + "title": "OpenAIResponseContentPartReasoningSummary", + "description": "Reasoning summary part in a streamed response." }, - "OpenAIResponseObjectStreamResponseFileSearchCallCompleted": { + "OpenAIResponseContentPartReasoningText": { "type": "object", "properties": { - "item_id": { + "type": { "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" + "const": "reasoning_text", + "default": "reasoning_text", + "description": "Content part type identifier, always \"reasoning_text\"" }, - "type": { + "text": { "type": "string", - "const": "response.file_search_call.completed", - "default": "response.file_search_call.completed", - "description": "Event type identifier, always \"response.file_search_call.completed\"" + "description": "Reasoning text supplied by the model" } }, "additionalProperties": false, "required": [ - "item_id", - "output_index", - "sequence_number", - "type" + "type", + "text" ], - "title": "OpenAIResponseObjectStreamResponseFileSearchCallCompleted", - "description": "Streaming event for completed file search calls." + "title": "OpenAIResponseContentPartReasoningText", + "description": "Reasoning text emitted as part of a streamed response." }, - "OpenAIResponseObjectStreamResponseFileSearchCallInProgress": { + "OpenAIResponseContentPartRefusal": { "type": "object", "properties": { - "item_id": { + "type": { "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" + "const": "refusal", + "default": "refusal", + "description": "Content part type identifier, always \"refusal\"" }, - "type": { + "refusal": { "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\"" + "description": "Refusal text supplied by the model" } }, "additionalProperties": false, "required": [ - "item_id", - "output_index", - "sequence_number", - "type" + "type", + "refusal" ], - "title": "OpenAIResponseObjectStreamResponseFileSearchCallInProgress", - "description": "Streaming event for file search calls in progress." + "title": "OpenAIResponseContentPartRefusal", + "description": "Refusal content within a streamed response part." + }, + "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" + } + } }, - "OpenAIResponseObjectStreamResponseFileSearchCallSearching": { + "OpenAIResponseObjectStreamResponseCompleted": { "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" + "response": { + "$ref": "#/components/schemas/OpenAIResponseObject", + "description": "Completed response object" }, "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\"" + "const": "response.completed", + "default": "response.completed", + "description": "Event type identifier, always \"response.completed\"" } }, "additionalProperties": false, "required": [ - "item_id", - "output_index", - "sequence_number", + "response", "type" ], - "title": "OpenAIResponseObjectStreamResponseFileSearchCallSearching", - "description": "Streaming event for file search currently searching." + "title": "OpenAIResponseObjectStreamResponseCompleted", + "description": "Streaming event indicating a response has been completed." }, - "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta": { + "OpenAIResponseObjectStreamResponseContentPartAdded": { "type": "object", "properties": { - "delta": { + "content_index": { + "type": "integer", + "description": "Index position of the part within the content array" + }, + "response_id": { "type": "string", - "description": "Incremental function call arguments being added" + "description": "Unique identifier of the response containing this content" }, "item_id": { "type": "string", - "description": "Unique identifier of the function call being updated" + "description": "Unique identifier of the output item containing this content part" }, "output_index": { "type": "integer", - "description": "Index position of the item in the output list" + "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", @@ -10805,36 +10219,64 @@ }, "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\"" + "const": "response.content_part.added", + "default": "response.content_part.added", + "description": "Event type identifier, always \"response.content_part.added\"" } }, "additionalProperties": false, "required": [ - "delta", + "content_index", + "response_id", "item_id", "output_index", + "part", "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta", - "description": "Streaming event for incremental function call argument updates." + "title": "OpenAIResponseObjectStreamResponseContentPartAdded", + "description": "Streaming event for when a new content part is added to a response item." }, - "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone": { + "OpenAIResponseObjectStreamResponseContentPartDone": { "type": "object", "properties": { - "arguments": { + "content_index": { + "type": "integer", + "description": "Index position of the part within the content array" + }, + "response_id": { "type": "string", - "description": "Final complete arguments JSON string for the function call" + "description": "Unique identifier of the response containing this content" }, "item_id": { "type": "string", - "description": "Unique identifier of the completed function call" + "description": "Unique identifier of the output item containing this content part" }, "output_index": { "type": "integer", - "description": "Index position of the item in the output list" + "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", @@ -10842,55 +10284,52 @@ }, "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\"" + "const": "response.content_part.done", + "default": "response.content_part.done", + "description": "Event type identifier, always \"response.content_part.done\"" } }, "additionalProperties": false, "required": [ - "arguments", + "content_index", + "response_id", "item_id", "output_index", + "part", "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone", - "description": "Streaming event for when function call arguments are completed." + "title": "OpenAIResponseObjectStreamResponseContentPartDone", + "description": "Streaming event for when a content part is completed." }, - "OpenAIResponseObjectStreamResponseInProgress": { + "OpenAIResponseObjectStreamResponseCreated": { "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" + "description": "The response object that was created" }, "type": { "type": "string", - "const": "response.in_progress", - "default": "response.in_progress", - "description": "Event type identifier, always \"response.in_progress\"" + "const": "response.created", + "default": "response.created", + "description": "Event type identifier, always \"response.created\"" } }, "additionalProperties": false, "required": [ "response", - "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseInProgress", - "description": "Streaming event indicating the response remains in progress." + "title": "OpenAIResponseObjectStreamResponseCreated", + "description": "Streaming event indicating a new response has been created." }, - "OpenAIResponseObjectStreamResponseIncomplete": { + "OpenAIResponseObjectStreamResponseFailed": { "type": "object", "properties": { "response": { "$ref": "#/components/schemas/OpenAIResponseObject", - "description": "Response object describing the incomplete state" + "description": "Response object describing the failure" }, "sequence_number": { "type": "integer", @@ -10898,9 +10337,9 @@ }, "type": { "type": "string", - "const": "response.incomplete", - "default": "response.incomplete", - "description": "Event type identifier, always \"response.incomplete\"" + "const": "response.failed", + "default": "response.failed", + "description": "Event type identifier, always \"response.failed\"" } }, "additionalProperties": false, @@ -10909,121 +10348,79 @@ "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseIncomplete", - "description": "Streaming event emitted when a response ends in an incomplete state." + "title": "OpenAIResponseObjectStreamResponseFailed", + "description": "Streaming event emitted when a response fails." }, - "OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta": { + "OpenAIResponseObjectStreamResponseFileSearchCallCompleted": { "type": "object", "properties": { - "delta": { - "type": "string" - }, "item_id": { - "type": "string" + "type": "string", + "description": "Unique identifier of the completed file 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.mcp_call.arguments.delta", - "default": "response.mcp_call.arguments.delta" + "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": [ - "delta", "item_id", "output_index", "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta" + "title": "OpenAIResponseObjectStreamResponseFileSearchCallCompleted", + "description": "Streaming event for completed file search calls." }, - "OpenAIResponseObjectStreamResponseMcpCallArgumentsDone": { + "OpenAIResponseObjectStreamResponseFileSearchCallInProgress": { "type": "object", "properties": { - "arguments": { - "type": "string" - }, "item_id": { - "type": "string" + "type": "string", + "description": "Unique identifier of the file search call" }, "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", - "description": "Sequential number for ordering streaming events" + "description": "Index position of the item in the output list" }, - "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\"" + "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": "OpenAIResponseObjectStreamResponseMcpCallFailed", - "description": "Streaming event for failed MCP calls." + "title": "OpenAIResponseObjectStreamResponseFileSearchCallInProgress", + "description": "Streaming event for file search calls in progress." }, - "OpenAIResponseObjectStreamResponseMcpCallInProgress": { + "OpenAIResponseObjectStreamResponseFileSearchCallSearching": { "type": "object", "properties": { "item_id": { "type": "string", - "description": "Unique identifier of the MCP call" + "description": "Unique identifier of the file search call" }, "output_index": { "type": "integer", @@ -11035,9 +10432,9 @@ }, "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\"" + "const": "response.file_search_call.searching", + "default": "response.file_search_call.searching", + "description": "Event type identifier, always \"response.file_search_call.searching\"" } }, "additionalProperties": false, @@ -11047,114 +10444,89 @@ "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseMcpCallInProgress", - "description": "Streaming event for MCP calls in progress." + "title": "OpenAIResponseObjectStreamResponseFileSearchCallSearching", + "description": "Streaming event for file search currently searching." }, - "OpenAIResponseObjectStreamResponseMcpListToolsCompleted": { + "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta": { "type": "object", "properties": { - "sequence_number": { - "type": "integer" + "delta": { + "type": "string", + "description": "Incremental function call arguments being added" }, - "type": { + "item_id": { "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": { + "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" + "type": "integer", + "description": "Sequential number for ordering streaming events" }, "type": { "type": "string", - "const": "response.mcp_list_tools.failed", - "default": "response.mcp_list_tools.failed" + "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": "OpenAIResponseObjectStreamResponseMcpListToolsFailed" + "title": "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDelta", + "description": "Streaming event for incremental function call argument updates." }, - "OpenAIResponseObjectStreamResponseMcpListToolsInProgress": { + "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" + "type": "integer", + "description": "Sequential number for ordering streaming events" }, "type": { "type": "string", - "const": "response.mcp_list_tools.in_progress", - "default": "response.mcp_list_tools.in_progress" + "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": "OpenAIResponseObjectStreamResponseMcpListToolsInProgress" + "title": "OpenAIResponseObjectStreamResponseFunctionCallArgumentsDone", + "description": "Streaming event for when function call arguments are completed." }, - "OpenAIResponseObjectStreamResponseOutputItemAdded": { + "OpenAIResponseObjectStreamResponseInProgress": { "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 output item that was added (message, tool call, etc.)" - }, - "output_index": { - "type": "integer", - "description": "Index position of this item in the output list" + "response": { + "$ref": "#/components/schemas/OpenAIResponseObject", + "description": "Current response state while in progress" }, "sequence_number": { "type": "integer", @@ -11162,70 +10534,26 @@ }, "type": { "type": "string", - "const": "response.output_item.added", - "default": "response.output_item.added", - "description": "Event type identifier, always \"response.output_item.added\"" + "const": "response.in_progress", + "default": "response.in_progress", + "description": "Event type identifier, always \"response.in_progress\"" } }, "additionalProperties": false, "required": [ - "response_id", - "item", - "output_index", + "response", "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseOutputItemAdded", - "description": "Streaming event for when a new output item is added to the response." + "title": "OpenAIResponseObjectStreamResponseInProgress", + "description": "Streaming event indicating the response remains in progress." }, - "OpenAIResponseObjectStreamResponseOutputItemDone": { + "OpenAIResponseObjectStreamResponseIncomplete": { "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" + "response": { + "$ref": "#/components/schemas/OpenAIResponseObject", + "description": "Response object describing the incomplete state" }, "sequence_number": { "type": "integer", @@ -11233,361 +10561,334 @@ }, "type": { "type": "string", - "const": "response.output_item.done", - "default": "response.output_item.done", - "description": "Event type identifier, always \"response.output_item.done\"" + "const": "response.incomplete", + "default": "response.incomplete", + "description": "Event type identifier, always \"response.incomplete\"" } }, "additionalProperties": false, "required": [ - "response_id", - "item", - "output_index", + "response", "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseOutputItemDone", - "description": "Streaming event for when an output item is completed." + "title": "OpenAIResponseObjectStreamResponseIncomplete", + "description": "Streaming event emitted when a response ends in an incomplete state." }, - "OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded": { + "OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta": { "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" + "delta": { + "type": "string" }, - "annotation_index": { - "type": "integer", - "description": "Index of the annotation within the content part" + "item_id": { + "type": "string" }, - "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" + "output_index": { + "type": "integer" }, "sequence_number": { - "type": "integer", - "description": "Sequential number for ordering streaming events" + "type": "integer" }, "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\"" + "const": "response.mcp_call.arguments.delta", + "default": "response.mcp_call.arguments.delta" } }, "additionalProperties": false, "required": [ + "delta", "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." + "title": "OpenAIResponseObjectStreamResponseMcpCallArgumentsDelta" }, - "OpenAIResponseObjectStreamResponseOutputTextDelta": { + "OpenAIResponseObjectStreamResponseMcpCallArgumentsDone": { "type": "object", "properties": { - "content_index": { - "type": "integer", - "description": "Index position within the text content" - }, - "delta": { - "type": "string", - "description": "Incremental text content being added" + "arguments": { + "type": "string" }, "item_id": { - "type": "string", - "description": "Unique identifier of the output item being updated" + "type": "string" }, "output_index": { - "type": "integer", - "description": "Index position of the item in the output list" + "type": "integer" }, "sequence_number": { - "type": "integer", - "description": "Sequential number for ordering streaming events" + "type": "integer" }, "type": { "type": "string", - "const": "response.output_text.delta", - "default": "response.output_text.delta", - "description": "Event type identifier, always \"response.output_text.delta\"" + "const": "response.mcp_call.arguments.done", + "default": "response.mcp_call.arguments.done" } }, "additionalProperties": false, "required": [ - "content_index", - "delta", + "arguments", "item_id", "output_index", "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseOutputTextDelta", - "description": "Streaming event for incremental text content updates." + "title": "OpenAIResponseObjectStreamResponseMcpCallArgumentsDone" }, - "OpenAIResponseObjectStreamResponseOutputTextDone": { + "OpenAIResponseObjectStreamResponseMcpCallCompleted": { "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\"" + "const": "response.mcp_call.completed", + "default": "response.mcp_call.completed", + "description": "Event type identifier, always \"response.mcp_call.completed\"" } }, "additionalProperties": false, "required": [ - "content_index", - "text", - "item_id", - "output_index", "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseOutputTextDone", - "description": "Streaming event for when text output is completed." + "title": "OpenAIResponseObjectStreamResponseMcpCallCompleted", + "description": "Streaming event for completed MCP calls." }, - "OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded": { + "OpenAIResponseObjectStreamResponseMcpCallFailed": { "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": { "type": "string", - "const": "response.reasoning_summary_part.added", - "default": "response.reasoning_summary_part.added", - "description": "Event type identifier, always \"response.reasoning_summary_part.added\"" + "const": "response.mcp_call.failed", + "default": "response.mcp_call.failed", + "description": "Event type identifier, always \"response.mcp_call.failed\"" } }, "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." + "title": "OpenAIResponseObjectStreamResponseMcpCallFailed", + "description": "Streaming event for failed MCP calls." }, - "OpenAIResponseObjectStreamResponseReasoningSummaryPartDone": { + "OpenAIResponseObjectStreamResponseMcpCallInProgress": { "type": "object", "properties": { "item_id": { "type": "string", - "description": "Unique identifier of the output item" + "description": "Unique identifier of the MCP call" }, "output_index": { "type": "integer", - "description": "Index position of the output item" - }, - "part": { - "$ref": "#/components/schemas/OpenAIResponseContentPartReasoningSummary", - "description": "The completed summary part" + "description": "Index position of the item in the output list" }, "sequence_number": { "type": "integer", "description": "Sequential number for ordering streaming events" }, - "summary_index": { - "type": "integer", - "description": "Index of the summary part within the reasoning summary" - }, "type": { "type": "string", - "const": "response.reasoning_summary_part.done", - "default": "response.reasoning_summary_part.done", - "description": "Event type identifier, always \"response.reasoning_summary_part.done\"" + "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", - "part", "sequence_number", - "summary_index", "type" ], - "title": "OpenAIResponseObjectStreamResponseReasoningSummaryPartDone", - "description": "Streaming event for when a reasoning summary part is completed." + "title": "OpenAIResponseObjectStreamResponseMcpCallInProgress", + "description": "Streaming event for MCP calls in progress." }, - "OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta": { + "OpenAIResponseObjectStreamResponseMcpListToolsCompleted": { "type": "object", "properties": { - "delta": { - "type": "string", - "description": "Incremental summary text being added" + "sequence_number": { + "type": "integer" }, - "item_id": { + "type": { "type": "string", - "description": "Unique identifier of the output item" - }, - "output_index": { - "type": "integer", - "description": "Index position of the output item" - }, + "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", - "description": "Sequential number for ordering streaming events" + "type": "integer" }, - "summary_index": { - "type": "integer", - "description": "Index of the summary part within the reasoning summary" + "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", + "properties": { + "sequence_number": { + "type": "integer" }, "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\"" + "const": "response.mcp_list_tools.in_progress", + "default": "response.mcp_list_tools.in_progress" } }, "additionalProperties": false, "required": [ - "delta", - "item_id", - "output_index", "sequence_number", - "summary_index", "type" ], - "title": "OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta", - "description": "Streaming event for incremental reasoning summary text updates." + "title": "OpenAIResponseObjectStreamResponseMcpListToolsInProgress" }, - "OpenAIResponseObjectStreamResponseReasoningSummaryTextDone": { + "OpenAIResponseObjectStreamResponseOutputItemAdded": { "type": "object", "properties": { - "text": { + "response_id": { "type": "string", - "description": "Final complete summary text" + "description": "Unique identifier of the response containing this output" }, - "item_id": { - "type": "string", - "description": "Unique identifier of the output item" + "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 the output item" - }, - "sequence_number": { - "type": "integer", - "description": "Sequential number for ordering streaming events" + "description": "Index position of this item in the output list" }, - "summary_index": { + "sequence_number": { "type": "integer", - "description": "Index of the summary part within the reasoning summary" + "description": "Sequential number for ordering streaming events" }, "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\"" + "const": "response.output_item.added", + "default": "response.output_item.added", + "description": "Event type identifier, always \"response.output_item.added\"" } }, "additionalProperties": false, "required": [ - "text", - "item_id", + "response_id", + "item", "output_index", "sequence_number", - "summary_index", "type" ], - "title": "OpenAIResponseObjectStreamResponseReasoningSummaryTextDone", - "description": "Streaming event for when reasoning summary text is completed." + "title": "OpenAIResponseObjectStreamResponseOutputItemAdded", + "description": "Streaming event for when a new output item is added to the response." }, - "OpenAIResponseObjectStreamResponseReasoningTextDelta": { + "OpenAIResponseObjectStreamResponseOutputItemDone": { "type": "object", "properties": { - "content_index": { - "type": "integer", - "description": "Index position of the reasoning content part" - }, - "delta": { + "response_id": { "type": "string", - "description": "Incremental reasoning text being added" + "description": "Unique identifier of the response containing this output" }, - "item_id": { - "type": "string", - "description": "Unique identifier of the output item being updated" + "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 the item in the output list" + "description": "Index position of this item in the output list" }, "sequence_number": { "type": "integer", @@ -11595,41 +10896,66 @@ }, "type": { "type": "string", - "const": "response.reasoning_text.delta", - "default": "response.reasoning_text.delta", - "description": "Event type identifier, always \"response.reasoning_text.delta\"" + "const": "response.output_item.done", + "default": "response.output_item.done", + "description": "Event type identifier, always \"response.output_item.done\"" } }, "additionalProperties": false, "required": [ - "content_index", - "delta", - "item_id", + "response_id", + "item", "output_index", "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseReasoningTextDelta", - "description": "Streaming event for incremental reasoning text updates." + "title": "OpenAIResponseObjectStreamResponseOutputItemDone", + "description": "Streaming event for when an output item is completed." }, - "OpenAIResponseObjectStreamResponseReasoningTextDone": { + "OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded": { "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" + "description": "Unique identifier of the item to which the annotation is being added" }, "output_index": { "type": "integer", - "description": "Index position of the item in the output list" + "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", @@ -11637,37 +10963,38 @@ }, "type": { "type": "string", - "const": "response.reasoning_text.done", - "default": "response.reasoning_text.done", - "description": "Event type identifier, always \"response.reasoning_text.done\"" + "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": [ - "content_index", - "text", "item_id", "output_index", + "content_index", + "annotation_index", + "annotation", "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseReasoningTextDone", - "description": "Streaming event for when reasoning text is completed." + "title": "OpenAIResponseObjectStreamResponseOutputTextAnnotationAdded", + "description": "Streaming event for when an annotation is added to output text." }, - "OpenAIResponseObjectStreamResponseRefusalDelta": { + "OpenAIResponseObjectStreamResponseOutputTextDelta": { "type": "object", "properties": { "content_index": { "type": "integer", - "description": "Index position of the content part" + "description": "Index position within the text content" }, "delta": { "type": "string", - "description": "Incremental refusal text being added" + "description": "Incremental text content being added" }, "item_id": { "type": "string", - "description": "Unique identifier of the output item" + "description": "Unique identifier of the output item being updated" }, "output_index": { "type": "integer", @@ -11679,9 +11006,9 @@ }, "type": { "type": "string", - "const": "response.refusal.delta", - "default": "response.refusal.delta", - "description": "Event type identifier, always \"response.refusal.delta\"" + "const": "response.output_text.delta", + "default": "response.output_text.delta", + "description": "Event type identifier, always \"response.output_text.delta\"" } }, "additionalProperties": false, @@ -11693,23 +11020,23 @@ "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseRefusalDelta", - "description": "Streaming event for incremental refusal text updates." + "title": "OpenAIResponseObjectStreamResponseOutputTextDelta", + "description": "Streaming event for incremental text content updates." }, - "OpenAIResponseObjectStreamResponseRefusalDone": { + "OpenAIResponseObjectStreamResponseOutputTextDone": { "type": "object", "properties": { "content_index": { "type": "integer", - "description": "Index position of the content part" + "description": "Index position within the text content" }, - "refusal": { + "text": { "type": "string", - "description": "Final complete refusal text" + "description": "Final complete text content of the output item" }, "item_id": { "type": "string", - "description": "Unique identifier of the output item" + "description": "Unique identifier of the completed output item" }, "output_index": { "type": "integer", @@ -11721,764 +11048,611 @@ }, "type": { "type": "string", - "const": "response.refusal.done", - "default": "response.refusal.done", - "description": "Event type identifier, always \"response.refusal.done\"" + "const": "response.output_text.done", + "default": "response.output_text.done", + "description": "Event type identifier, always \"response.output_text.done\"" } }, "additionalProperties": false, "required": [ "content_index", - "refusal", + "text", "item_id", "output_index", "sequence_number", "type" ], - "title": "OpenAIResponseObjectStreamResponseRefusalDone", - "description": "Streaming event for when refusal text is completed." + "title": "OpenAIResponseObjectStreamResponseOutputTextDone", + "description": "Streaming event for when text output is completed." }, - "OpenAIResponseObjectStreamResponseWebSearchCallCompleted": { + "OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded": { "type": "object", "properties": { "item_id": { "type": "string", - "description": "Unique identifier of the completed web search call" + "description": "Unique identifier of the output item" }, "output_index": { "type": "integer", - "description": "Index position of the item in the output list" + "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": { "type": "string", - "const": "response.web_search_call.completed", - "default": "response.web_search_call.completed", - "description": "Event type identifier, always \"response.web_search_call.completed\"" + "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": "OpenAIResponseObjectStreamResponseWebSearchCallCompleted", - "description": "Streaming event for completed web search calls." + "title": "OpenAIResponseObjectStreamResponseReasoningSummaryPartAdded", + "description": "Streaming event for when a new reasoning summary part is added." }, - "OpenAIResponseObjectStreamResponseWebSearchCallInProgress": { + "OpenAIResponseObjectStreamResponseReasoningSummaryPartDone": { "type": "object", "properties": { "item_id": { "type": "string", - "description": "Unique identifier of the web search call" + "description": "Unique identifier of the output item" }, "output_index": { "type": "integer", - "description": "Index position of the item in the output list" + "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": { "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\"" + "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": "OpenAIResponseObjectStreamResponseWebSearchCallInProgress", - "description": "Streaming event for web search calls in progress." + "title": "OpenAIResponseObjectStreamResponseReasoningSummaryPartDone", + "description": "Streaming event for when a reasoning summary part is completed." }, - "OpenAIResponseObjectStreamResponseWebSearchCallSearching": { + "OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta": { "type": "object", "properties": { + "delta": { + "type": "string", + "description": "Incremental summary text being added" + }, "item_id": { - "type": "string" + "type": "string", + "description": "Unique identifier of the output item" }, "output_index": { - "type": "integer" + "type": "integer", + "description": "Index position of the output item" + }, + "sequence_number": { + "type": "integer", + "description": "Sequential number for ordering streaming events" }, - "sequence_number": { - "type": "integer" + "summary_index": { + "type": "integer", + "description": "Index of the summary part within the reasoning summary" }, "type": { "type": "string", - "const": "response.web_search_call.searching", - "default": "response.web_search_call.searching" + "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": "OpenAIResponseObjectStreamResponseWebSearchCallSearching" + "title": "OpenAIResponseObjectStreamResponseReasoningSummaryTextDelta", + "description": "Streaming event for incremental reasoning summary text updates." }, - "OpenAIDeleteResponseObject": { + "OpenAIResponseObjectStreamResponseReasoningSummaryTextDone": { "type": "object", "properties": { - "id": { - "type": "string", - "description": "Unique identifier of the deleted response" - }, - "object": { + "text": { "type": "string", - "const": "response", - "default": "response", - "description": "Object type identifier, always \"response\"" - }, - "deleted": { - "type": "boolean", - "default": true, - "description": "Deletion confirmation flag, always True" - } - }, - "additionalProperties": false, - "required": [ - "id", - "object", - "deleted" - ], - "title": "OpenAIDeleteResponseObject", - "description": "Response object confirming deletion of an OpenAI response." - }, - "ListOpenAIResponseInputItem": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAIResponseInput" - }, - "description": "List of input items" + "description": "Final complete summary text" }, - "object": { + "item_id": { "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": { - "type": "object", - "properties": { - "completed": { - "type": "integer", - "description": "Number of files that have been successfully processed" + "description": "Unique identifier of the output item" }, - "cancelled": { + "output_index": { "type": "integer", - "description": "Number of files that had their processing cancelled" + "description": "Index position of the output item" }, - "failed": { + "sequence_number": { "type": "integer", - "description": "Number of files that failed to process" + "description": "Sequential number for ordering streaming events" }, - "in_progress": { + "summary_index": { "type": "integer", - "description": "Number of files currently being processed" + "description": "Index of the summary part within the reasoning summary" }, - "total": { - "type": "integer", - "description": "Total number of files in the vector store" + "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": [ - "completed", - "cancelled", - "failed", - "in_progress", - "total" + "text", + "item_id", + "output_index", + "sequence_number", + "summary_index", + "type" ], - "title": "VectorStoreFileCounts", - "description": "File processing status counts for a vector store." + "title": "OpenAIResponseObjectStreamResponseReasoningSummaryTextDone", + "description": "Streaming event for when reasoning summary text is completed." }, - "VectorStoreListResponse": { + "OpenAIResponseObjectStreamResponseReasoningTextDelta": { "type": "object", "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" + "content_index": { + "type": "integer", + "description": "Index position of the reasoning content part" }, - "first_id": { + "delta": { "type": "string", - "description": "(Optional) ID of the first vector store in the list for pagination" + "description": "Incremental reasoning text being added" }, - "last_id": { + "item_id": { "type": "string", - "description": "(Optional) ID of the last vector store in the list for pagination" + "description": "Unique identifier of the output item being updated" }, - "has_more": { - "type": "boolean", - "default": false, - "description": "Whether there are more vector stores available beyond this page" + "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.delta", + "default": "response.reasoning_text.delta", + "description": "Event type identifier, always \"response.reasoning_text.delta\"" } }, "additionalProperties": false, "required": [ - "object", - "data", - "has_more" + "content_index", + "delta", + "item_id", + "output_index", + "sequence_number", + "type" ], - "title": "VectorStoreListResponse", - "description": "Response from listing vector stores." + "title": "OpenAIResponseObjectStreamResponseReasoningTextDelta", + "description": "Streaming event for incremental reasoning text updates." }, - "VectorStoreObject": { + "OpenAIResponseObjectStreamResponseReasoningTextDone": { "type": "object", "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": { + "content_index": { "type": "integer", - "description": "Timestamp when the vector store was created" + "description": "Index position of the reasoning content part" }, - "name": { + "text": { "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" + "description": "Final complete reasoning text" }, - "status": { + "item_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" + "description": "Unique identifier of the completed output item" + }, + "output_index": { + "type": "integer", + "description": "Index position of the item in the output list" + }, + "sequence_number": { + "type": "integer", + "description": "Sequential number for ordering streaming events" + }, + "type": { + "type": "string", + "const": "response.reasoning_text.done", + "default": "response.reasoning_text.done", + "description": "Event type identifier, always \"response.reasoning_text.done\"" } }, "additionalProperties": false, "required": [ - "id", - "object", - "created_at", - "usage_bytes", - "file_counts", - "status", - "metadata" + "content_index", + "text", + "item_id", + "output_index", + "sequence_number", + "type" ], - "title": "VectorStoreObject", - "description": "OpenAI Vector Store object." + "title": "OpenAIResponseObjectStreamResponseReasoningTextDone", + "description": "Streaming event for when reasoning text is completed." }, - "OpenAICreateVectorStoreRequestWithExtraBody": { + "OpenAIResponseObjectStreamResponseRefusalDelta": { "type": "object", "properties": { - "name": { + "content_index": { + "type": "integer", + "description": "Index position of the content part" + }, + "delta": { "type": "string", - "description": "(Optional) A name for the vector store" + "description": "Incremental refusal text being added" }, - "file_ids": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of file IDs to include in the vector store" + "item_id": { + "type": "string", + "description": "Unique identifier of the output item" }, - "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" + "output_index": { + "type": "integer", + "description": "Index position of the item in the output list" }, - "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" + "sequence_number": { + "type": "integer", + "description": "Sequential number for ordering streaming events" }, - "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" + "type": { + "type": "string", + "const": "response.refusal.delta", + "default": "response.refusal.delta", + "description": "Event type identifier, always \"response.refusal.delta\"" } }, "additionalProperties": false, - "title": "OpenAICreateVectorStoreRequestWithExtraBody", - "description": "Request to create a vector store with extra_body support." + "required": [ + "content_index", + "delta", + "item_id", + "output_index", + "sequence_number", + "type" + ], + "title": "OpenAIResponseObjectStreamResponseRefusalDelta", + "description": "Streaming event for incremental refusal text updates." }, - "OpenaiUpdateVectorStoreRequest": { + "OpenAIResponseObjectStreamResponseRefusalDone": { "type": "object", "properties": { - "name": { + "content_index": { + "type": "integer", + "description": "Index position of the content part" + }, + "refusal": { "type": "string", - "description": "The name of the vector store." + "description": "Final complete refusal text" }, - "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." + "item_id": { + "type": "string", + "description": "Unique identifier of the output item" }, - "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." + "output_index": { + "type": "integer", + "description": "Index position of the item in the output list" + }, + "sequence_number": { + "type": "integer", + "description": "Sequential number for ordering streaming events" + }, + "type": { + "type": "string", + "const": "response.refusal.done", + "default": "response.refusal.done", + "description": "Event type identifier, always \"response.refusal.done\"" } }, "additionalProperties": false, - "title": "OpenaiUpdateVectorStoreRequest" + "required": [ + "content_index", + "refusal", + "item_id", + "output_index", + "sequence_number", + "type" + ], + "title": "OpenAIResponseObjectStreamResponseRefusalDone", + "description": "Streaming event for when refusal text is completed." }, - "VectorStoreDeleteResponse": { + "OpenAIResponseObjectStreamResponseWebSearchCallCompleted": { "type": "object", "properties": { - "id": { + "item_id": { "type": "string", - "description": "Unique identifier of the deleted vector store" + "description": "Unique identifier of the completed web search call" }, - "object": { - "type": "string", - "default": "vector_store.deleted", - "description": "Object type identifier for the deletion response" + "output_index": { + "type": "integer", + "description": "Index position of the item in the output list" }, - "deleted": { - "type": "boolean", - "default": true, - "description": "Whether the deletion operation was successful" + "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": [ - "id", - "object", - "deleted" - ], - "title": "VectorStoreDeleteResponse", - "description": "Response from deleting a vector store." - }, - "VectorStoreChunkingStrategy": { - "oneOf": [ - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" - }, - { - "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" - } + "item_id", + "output_index", + "sequence_number", + "type" ], - "discriminator": { - "propertyName": "type", - "mapping": { - "auto": "#/components/schemas/VectorStoreChunkingStrategyAuto", - "static": "#/components/schemas/VectorStoreChunkingStrategyStatic" - } - } + "title": "OpenAIResponseObjectStreamResponseWebSearchCallCompleted", + "description": "Streaming event for completed web search calls." }, - "VectorStoreChunkingStrategyAuto": { + "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": "auto", - "default": "auto", - "description": "Strategy type, always \"auto\" for automatic chunking" + "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": "VectorStoreChunkingStrategyAuto", - "description": "Automatic chunking strategy for vector store files." + "title": "OpenAIResponseObjectStreamResponseWebSearchCallInProgress", + "description": "Streaming event for web search calls in progress." }, - "VectorStoreChunkingStrategyStatic": { + "OpenAIResponseObjectStreamResponseWebSearchCallSearching": { "type": "object", "properties": { + "item_id": { + "type": "string" + }, + "output_index": { + "type": "integer" + }, + "sequence_number": { + "type": "integer" + }, "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" + "const": "response.web_search_call.searching", + "default": "response.web_search_call.searching" } }, "additionalProperties": false, "required": [ - "type", - "static" + "item_id", + "output_index", + "sequence_number", + "type" ], - "title": "VectorStoreChunkingStrategyStatic", - "description": "Static chunking strategy with configurable parameters." + "title": "OpenAIResponseObjectStreamResponseWebSearchCallSearching" }, - "VectorStoreChunkingStrategyStaticConfig": { + "OpenAIDeleteResponseObject": { "type": "object", "properties": { - "chunk_overlap_tokens": { - "type": "integer", - "default": 400, - "description": "Number of tokens to overlap between adjacent chunks" + "id": { + "type": "string", + "description": "Unique identifier of the deleted response" }, - "max_chunk_size_tokens": { - "type": "integer", - "default": 800, - "description": "Maximum number of tokens per chunk, must be between 100 and 4096" + "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": [ - "chunk_overlap_tokens", - "max_chunk_size_tokens" + "id", + "object", + "deleted" ], - "title": "VectorStoreChunkingStrategyStaticConfig", - "description": "Configuration for static chunking strategy." + "title": "OpenAIDeleteResponseObject", + "description": "Response object confirming deletion of an OpenAI response." }, - "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": { + "ListOpenAIResponseInputItem": { "type": "object", "properties": { - "file_ids": { + "data": { "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" - } - ] + "$ref": "#/components/schemas/OpenAIResponseInput" }, - "description": "(Optional) Key-value attributes to store with the files" + "description": "List of input items" }, - "chunking_strategy": { - "$ref": "#/components/schemas/VectorStoreChunkingStrategy", - "description": "(Optional) The chunking strategy used to chunk the file(s). Defaults to auto" + "object": { + "type": "string", + "const": "list", + "default": "list", + "description": "Object type identifier, always \"list\"" } }, "additionalProperties": false, "required": [ - "file_ids" + "data", + "object" ], - "title": "OpenAICreateVectorStoreFileBatchRequestWithExtraBody", - "description": "Request to create a vector store file batch with extra_body support." + "title": "ListOpenAIResponseInputItem", + "description": "List container for OpenAI response input items." }, - "VectorStoreFileBatchObject": { + "VectorStoreFileCounts": { "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\"" + "completed": { + "type": "integer", + "description": "Number of files that have been successfully processed" }, - "created_at": { + "cancelled": { "type": "integer", - "description": "Timestamp when the file batch was created" + "description": "Number of files that had their processing cancelled" }, - "vector_store_id": { - "type": "string", - "description": "ID of the vector store containing the file batch" + "failed": { + "type": "integer", + "description": "Number of files that failed to process" }, - "status": { - "$ref": "#/components/schemas/VectorStoreFileStatus", - "description": "Current processing status of the file batch" + "in_progress": { + "type": "integer", + "description": "Number of files currently being processed" }, - "file_counts": { - "$ref": "#/components/schemas/VectorStoreFileCounts", - "description": "File processing status counts for the batch" + "total": { + "type": "integer", + "description": "Total number of files in the vector store" } }, "additionalProperties": false, "required": [ - "id", - "object", - "created_at", - "vector_store_id", - "status", - "file_counts" + "completed", + "cancelled", + "failed", + "in_progress", + "total" ], - "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" - } - ] + "title": "VectorStoreFileCounts", + "description": "File processing status counts for a vector store." }, - "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" + "VectorStoreListResponse": { + "type": "object", + "properties": { + "object": { + "type": "string", + "default": "list", + "description": "Object type identifier, always \"list\"" }, - "message": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VectorStoreObject" + }, + "description": "List of vector store objects" + }, + "first_id": { "type": "string", - "description": "Human-readable error message describing the failure" + "description": "(Optional) ID of the first vector store in the list for pagination" + }, + "last_id": { + "type": "string", + "description": "(Optional) ID of the last vector store in the list for pagination" + }, + "has_more": { + "type": "boolean", + "default": false, + "description": "Whether there are more vector stores available beyond this page" } }, "additionalProperties": false, "required": [ - "code", - "message" + "object", + "data", + "has_more" ], - "title": "VectorStoreFileLastError", - "description": "Error information for failed vector store file processing." + "title": "VectorStoreListResponse", + "description": "Response from listing vector stores." }, - "VectorStoreFileObject": { + "VectorStoreObject": { "type": "object", "properties": { "id": { "type": "string", - "description": "Unique identifier for the file" + "description": "Unique identifier for the vector store" }, "object": { "type": "string", - "default": "vector_store.file", - "description": "Object type identifier, always \"vector_store.file\"" + "default": "vector_store", + "description": "Object type identifier, always \"vector_store\"" }, - "attributes": { + "created_at": { + "type": "integer", + "description": "Timestamp when the vector store was created" + }, + "name": { + "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": { + "type": "string", + "default": "completed", + "description": "Current status of the vector store" + }, + "expires_after": { "type": "object", "additionalProperties": { "oneOf": [ @@ -12502,146 +11676,161 @@ } ] }, - "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" + "description": "(Optional) Expiration policy for the vector store" }, - "created_at": { + "expires_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" + "description": "(Optional) Timestamp when the vector store will expire" }, - "usage_bytes": { + "last_active_at": { "type": "integer", - "default": 0, - "description": "Storage space used by this file in bytes" + "description": "(Optional) Timestamp of last activity on the vector store" }, - "vector_store_id": { - "type": "string", - "description": "ID of the vector store containing this file" + "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", - "attributes", - "chunking_strategy", "created_at", - "status", "usage_bytes", - "vector_store_id" + "file_counts", + "status", + "metadata" ], - "title": "VectorStoreFileObject", - "description": "OpenAI Vector Store File object." + "title": "VectorStoreObject", + "description": "OpenAI Vector Store object." }, - "VectorStoreFilesListInBatchResponse": { + "OpenAICreateVectorStoreRequestWithExtraBody": { "type": "object", "properties": { - "object": { + "name": { "type": "string", - "default": "list", - "description": "Object type identifier, always \"list\"" + "description": "(Optional) A name for the vector store" }, - "data": { + "file_ids": { "type": "array", "items": { - "$ref": "#/components/schemas/VectorStoreFileObject" + "type": "string" }, - "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" + "description": "List of file IDs to include in the vector store" }, - "last_id": { - "type": "string", - "description": "(Optional) ID of the last file in the list for pagination" + "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" }, - "has_more": { - "type": "boolean", - "default": false, - "description": "Whether there are more files available beyond this page" - } - }, - "additionalProperties": false, - "required": [ - "object", - "data", - "has_more" - ], - "title": "VectorStoreFilesListInBatchResponse", - "description": "Response from listing files in a vector store file batch." - }, - "VectorStoreListFilesResponse": { - "type": "object", - "properties": { - "object": { - "type": "string", - "default": "list", - "description": "Object type identifier, always \"list\"" + "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" }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/VectorStoreFileObject" + "metadata": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] }, - "description": "List of vector store file objects" - }, - "first_id": { - "type": "string", - "description": "(Optional) ID of the first file in the list for pagination" - }, - "last_id": { - "type": "string", - "description": "(Optional) ID of the last file in the list for pagination" - }, - "has_more": { - "type": "boolean", - "default": false, - "description": "Whether there are more files available beyond this page" + "description": "Set of key-value pairs that can be attached to the vector store" } }, "additionalProperties": false, - "required": [ - "object", - "data", - "has_more" - ], - "title": "VectorStoreListFilesResponse", - "description": "Response from listing files in a vector store." + "title": "OpenAICreateVectorStoreRequestWithExtraBody", + "description": "Request to create a vector store with extra_body support." }, - "OpenaiAttachFileToVectorStoreRequest": { + "OpenaiUpdateVectorStoreRequest": { "type": "object", "properties": { - "file_id": { + "name": { "type": "string", - "description": "The ID of the file to attach to the vector store." + "description": "The name of the vector store." }, - "attributes": { + "expires_after": { "type": "object", "additionalProperties": { "oneOf": [ @@ -12665,23 +11854,9 @@ } ] }, - "description": "The key-value attributes stored with the file, which can be used for filtering." + "description": "The expiration policy for a vector store." }, - "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": { + "metadata": { "type": "object", "additionalProperties": { "oneOf": [ @@ -12705,25 +11880,22 @@ } ] }, - "description": "The updated key-value attributes to store with the file." + "description": "Set of 16 key-value pairs that can be attached to an object." } }, "additionalProperties": false, - "required": [ - "attributes" - ], - "title": "OpenaiUpdateVectorStoreFileRequest" + "title": "OpenaiUpdateVectorStoreRequest" }, - "VectorStoreFileDeleteResponse": { + "VectorStoreDeleteResponse": { "type": "object", "properties": { "id": { "type": "string", - "description": "Unique identifier of the deleted file" + "description": "Unique identifier of the deleted vector store" }, "object": { "type": "string", - "default": "vector_store.file.deleted", + "default": "vector_store.deleted", "description": "Object type identifier for the deletion response" }, "deleted": { @@ -12738,40 +11910,96 @@ "object", "deleted" ], - "title": "VectorStoreFileDeleteResponse", - "description": "Response from deleting a vector store file." + "title": "VectorStoreDeleteResponse", + "description": "Response from deleting a vector store." }, - "VectorStoreContent": { + "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": "text", - "description": "Content type, currently only \"text\" is supported" - }, - "text": { + "const": "auto", + "default": "auto", + "description": "Strategy type, always \"auto\" for automatic chunking" + } + }, + "additionalProperties": false, + "required": [ + "type" + ], + "title": "VectorStoreChunkingStrategyAuto", + "description": "Automatic chunking strategy for vector store files." + }, + "VectorStoreChunkingStrategyStatic": { + "type": "object", + "properties": { + "type": { "type": "string", - "description": "The actual text content" + "const": "static", + "default": "static", + "description": "Strategy type, always \"static\" for static chunking" + }, + "static": { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyStaticConfig", + "description": "Configuration parameters for the static chunking strategy" } }, "additionalProperties": false, "required": [ "type", - "text" + "static" ], - "title": "VectorStoreContent", - "description": "Content item from a vector store file or search result." + "title": "VectorStoreChunkingStrategyStatic", + "description": "Static chunking strategy with configurable parameters." }, - "VectorStoreFileContentsResponse": { + "VectorStoreChunkingStrategyStaticConfig": { "type": "object", "properties": { - "file_id": { - "type": "string", - "description": "Unique identifier for the file" + "chunk_overlap_tokens": { + "type": "integer", + "default": 400, + "description": "Number of tokens to overlap between adjacent chunks" }, - "filename": { - "type": "string", - "description": "Name of the file" + "max_chunk_size_tokens": { + "type": "integer", + "default": 800, + "description": "Maximum number of tokens per chunk, must be between 100 and 4096" + } + }, + "additionalProperties": false, + "required": [ + "chunk_overlap_tokens", + "max_chunk_size_tokens" + ], + "title": "VectorStoreChunkingStrategyStaticConfig", + "description": "Configuration for static chunking strategy." + }, + "OpenAICreateVectorStoreFileBatchRequestWithExtraBody": { + "type": "object", + "properties": { + "file_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of File IDs that the vector store should use" }, "attributes": { "type": "object", @@ -12797,334 +12025,286 @@ } ] }, - "description": "Key-value attributes associated with the file" + "description": "(Optional) Key-value attributes to store with the files" }, - "content": { - "type": "array", - "items": { - "$ref": "#/components/schemas/VectorStoreContent" - }, - "description": "List of content items from the file" + "chunking_strategy": { + "$ref": "#/components/schemas/VectorStoreChunkingStrategy", + "description": "(Optional) The chunking strategy used to chunk the file(s). Defaults to auto" } }, "additionalProperties": false, "required": [ - "file_id", - "filename", - "attributes", - "content" + "file_ids" ], - "title": "VectorStoreFileContentsResponse", - "description": "Response from retrieving the contents of a vector store file." + "title": "OpenAICreateVectorStoreFileBatchRequestWithExtraBody", + "description": "Request to create a vector store file batch with extra_body support." }, - "OpenaiSearchVectorStoreRequest": { + "VectorStoreFileBatchObject": { "type": "object", "properties": { - "query": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ], - "description": "The query string or array for performing the search." + "id": { + "type": "string", + "description": "Unique identifier for the file batch" }, - "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." + "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" }, - "max_num_results": { - "type": "integer", - "description": "Maximum number of results to return (1 to 50 inclusive, default 10)." + { + "type": "string", + "const": "in_progress" }, - "ranking_options": { - "type": "object", - "properties": { - "ranker": { + { + "type": "string", + "const": "cancelled" + }, + { + "type": "string", + "const": "failed" + } + ] + }, + "VectorStoreFileLastError": { + "type": "object", + "properties": { + "code": { + "oneOf": [ + { "type": "string", - "description": "(Optional) Name of the ranking algorithm to use" + "const": "server_error" }, - "score_threshold": { - "type": "number", - "default": 0.0, - "description": "(Optional) Minimum relevance score threshold for results" + { + "type": "string", + "const": "rate_limit_exceeded" } - }, - "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)" + ], + "description": "Error code indicating the type of failure" }, - "search_mode": { + "message": { "type": "string", - "description": "The search mode to use - \"keyword\", \"vector\", or \"hybrid\" (default \"vector\")" + "description": "Human-readable error message describing the failure" } }, "additionalProperties": false, "required": [ - "query" + "code", + "message" ], - "title": "OpenaiSearchVectorStoreRequest" + "title": "VectorStoreFileLastError", + "description": "Error information for failed vector store file processing." }, - "VectorStoreSearchResponse": { + "VectorStoreFileObject": { "type": "object", "properties": { - "file_id": { + "id": { "type": "string", - "description": "Unique identifier of the file containing the result" + "description": "Unique identifier for the file" }, - "filename": { + "object": { "type": "string", - "description": "Name of the file containing the result" - }, - "score": { - "type": "number", - "description": "Relevance score for this search result" + "default": "vector_store.file", + "description": "Object type identifier, always \"vector_store.file\"" }, "attributes": { "type": "object", "additionalProperties": { "oneOf": [ { - "type": "string" + "type": "null" + }, + { + "type": "boolean" }, { "type": "number" }, { - "type": "boolean" + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" } ] }, - "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": { - "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" + "description": "Key-value attributes associated with the file" }, - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/VectorStoreSearchResponse" + "chunking_strategy": { + "oneOf": [ + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyAuto" + }, + { + "$ref": "#/components/schemas/VectorStoreChunkingStrategyStatic" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "auto": "#/components/schemas/VectorStoreChunkingStrategyAuto", + "static": "#/components/schemas/VectorStoreChunkingStrategyStatic" + } }, - "description": "List of search result objects" + "description": "Strategy used for splitting the file into chunks" }, - "has_more": { - "type": "boolean", - "default": false, - "description": "Whether there are more results available beyond this page" + "created_at": { + "type": "integer", + "description": "Timestamp when the file was added to the vector store" }, - "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" + "last_error": { + "$ref": "#/components/schemas/VectorStoreFileLastError", + "description": "(Optional) Error information if file processing failed" }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp when the checkpoint was created" + "status": { + "$ref": "#/components/schemas/VectorStoreFileStatus", + "description": "Current processing status of the file" }, - "epoch": { + "usage_bytes": { "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" + "default": 0, + "description": "Storage space used by this file in bytes" }, - "path": { + "vector_store_id": { "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" + "description": "ID of the vector store containing this file" } }, "additionalProperties": false, "required": [ - "identifier", + "id", + "object", + "attributes", + "chunking_strategy", "created_at", - "epoch", - "post_training_job_id", - "path" + "status", + "usage_bytes", + "vector_store_id" ], - "title": "Checkpoint", - "description": "Checkpoint created during training runs." + "title": "VectorStoreFileObject", + "description": "OpenAI Vector Store File object." }, - "PostTrainingJobArtifactsResponse": { + "VectorStoreFilesListInBatchResponse": { "type": "object", "properties": { - "job_uuid": { + "object": { "type": "string", - "description": "Unique identifier for the training job" + "default": "list", + "description": "Object type identifier, always \"list\"" }, - "checkpoints": { + "data": { "type": "array", "items": { - "$ref": "#/components/schemas/Checkpoint" + "$ref": "#/components/schemas/VectorStoreFileObject" }, - "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" + "description": "List of vector store file objects in the batch" }, - "train_loss": { - "type": "number", - "description": "Loss value on the training dataset" + "first_id": { + "type": "string", + "description": "(Optional) ID of the first file in the list for pagination" }, - "validation_loss": { - "type": "number", - "description": "Loss value on the validation dataset" + "last_id": { + "type": "string", + "description": "(Optional) ID of the last file in the list for pagination" }, - "perplexity": { - "type": "number", - "description": "Perplexity metric indicating model confidence" + "has_more": { + "type": "boolean", + "default": false, + "description": "Whether there are more files available beyond this page" } }, "additionalProperties": false, "required": [ - "epoch", - "train_loss", - "validation_loss", - "perplexity" + "object", + "data", + "has_more" ], - "title": "PostTrainingMetric", - "description": "Training metrics captured during post-training jobs." + "title": "VectorStoreFilesListInBatchResponse", + "description": "Response from listing files in a vector store file batch." }, - "CancelTrainingJobRequest": { + "VectorStoreListFilesResponse": { "type": "object", "properties": { - "job_uuid": { + "object": { "type": "string", - "description": "The UUID of the job to cancel." + "default": "list", + "description": "Object type identifier, always \"list\"" + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/VectorStoreFileObject" + }, + "description": "List of vector store file objects" + }, + "first_id": { + "type": "string", + "description": "(Optional) ID of the first file in the list for pagination" + }, + "last_id": { + "type": "string", + "description": "(Optional) ID of the last file in the list for pagination" + }, + "has_more": { + "type": "boolean", + "default": false, + "description": "Whether there are more files available beyond this page" } }, "additionalProperties": false, "required": [ - "job_uuid" + "object", + "data", + "has_more" ], - "title": "CancelTrainingJobRequest" + "title": "VectorStoreListFilesResponse", + "description": "Response from listing files in a vector store." }, - "PostTrainingJobStatusResponse": { + "OpenaiAttachFileToVectorStoreRequest": { "type": "object", "properties": { - "job_uuid": { - "type": "string", - "description": "Unique identifier for the training job" - }, - "status": { - "type": "string", - "enum": [ - "completed", - "in_progress", - "failed", - "scheduled", - "cancelled" - ], - "description": "Current status of the training job" - }, - "scheduled_at": { - "type": "string", - "format": "date-time", - "description": "(Optional) Timestamp when the job was scheduled" - }, - "started_at": { - "type": "string", - "format": "date-time", - "description": "(Optional) Timestamp when the job execution began" - }, - "completed_at": { + "file_id": { "type": "string", - "format": "date-time", - "description": "(Optional) Timestamp when the job finished, if completed" + "description": "The ID of the file to attach to the vector store." }, - "resources_allocated": { + "attributes": { "type": "object", "additionalProperties": { "oneOf": [ @@ -13148,272 +12328,115 @@ } ] }, - "description": "(Optional) Information about computational resources allocated to the job" + "description": "The key-value attributes stored with the file, which can be used for filtering." }, - "checkpoints": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Checkpoint" - }, - "description": "List of model checkpoints created during training" + "chunking_strategy": { + "$ref": "#/components/schemas/VectorStoreChunkingStrategy", + "description": "The chunking strategy to use for the file." } }, "additionalProperties": false, "required": [ - "job_uuid", - "status", - "checkpoints" + "file_id" ], - "title": "PostTrainingJobStatusResponse", - "description": "Status of a finetuning job." + "title": "OpenaiAttachFileToVectorStoreRequest" }, - "ListPostTrainingJobsResponse": { + "OpenaiUpdateVectorStoreFileRequest": { "type": "object", "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "job_uuid": { + "attributes": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" } - }, - "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": { - "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" + ] + }, + "description": "The updated key-value attributes to store with the file." } }, - "additionalProperties": false, - "title": "EfficiencyConfig", - "description": "Configuration for memory and compute efficiency optimizations." + "additionalProperties": false, + "required": [ + "attributes" + ], + "title": "OpenaiUpdateVectorStoreFileRequest" }, - "OptimizerConfig": { + "VectorStoreFileDeleteResponse": { "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" + "id": { + "type": "string", + "description": "Unique identifier of the deleted file" }, - "weight_decay": { - "type": "number", - "description": "Weight decay coefficient for regularization" + "object": { + "type": "string", + "default": "vector_store.file.deleted", + "description": "Object type identifier for the deletion response" }, - "num_warmup_steps": { - "type": "integer", - "description": "Number of steps for learning rate warmup" + "deleted": { + "type": "boolean", + "default": true, + "description": "Whether the deletion operation was successful" } }, "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" + "id", + "object", + "deleted" ], - "title": "OptimizerType", - "description": "Available optimizer algorithms for training." + "title": "VectorStoreFileDeleteResponse", + "description": "Response from deleting a vector store file." }, - "TrainingConfig": { + "VectorStoreContent": { "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" + "type": { + "type": "string", + "const": "text", + "description": "Content type, currently only \"text\" is supported" }, - "dtype": { + "text": { "type": "string", - "default": "bf16", - "description": "(Optional) Data type for model parameters (bf16, fp16, fp32)" + "description": "The actual text content" } }, "additionalProperties": false, "required": [ - "n_epochs", - "max_steps_per_epoch", - "gradient_accumulation_steps" + "type", + "text" ], - "title": "TrainingConfig", - "description": "Comprehensive configuration for the training process." + "title": "VectorStoreContent", + "description": "Content item from a vector store file or search result." }, - "PreferenceOptimizeRequest": { + "VectorStoreFileContentsResponse": { "type": "object", "properties": { - "job_uuid": { + "file_id": { "type": "string", - "description": "The UUID of the job to create." + "description": "Unique identifier for the file" }, - "finetuned_model": { + "filename": { "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." + "description": "Name of the file" }, - "hyperparam_search_config": { + "attributes": { "type": "object", "additionalProperties": { "oneOf": [ @@ -13437,9 +12460,44 @@ } ] }, - "description": "The hyperparam search configuration." + "description": "Key-value attributes associated with the file" }, - "logger_config": { + "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": [ @@ -13463,170 +12521,273 @@ } ] }, - "description": "The logger configuration." + "description": "Filters based on file attributes to narrow the search results." + }, + "max_num_results": { + "type": "integer", + "description": "Maximum number of results to return (1 to 50 inclusive, default 10)." + }, + "ranking_options": { + "type": "object", + "properties": { + "ranker": { + "type": "string", + "description": "(Optional) Name of the ranking algorithm to use" + }, + "score_threshold": { + "type": "number", + "default": 0.0, + "description": "(Optional) Minimum relevance score threshold for results" + } + }, + "additionalProperties": false, + "description": "Ranking options for fine-tuning the search results." + }, + "rewrite_query": { + "type": "boolean", + "description": "Whether to rewrite the natural language query for vector search (default false)" + }, + "search_mode": { + "type": "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": { + "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": { + "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": { + "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": [ - "job_uuid", - "finetuned_model", - "algorithm_config", - "training_config", - "hyperparam_search_config", - "logger_config" + "object", + "search_query", + "data", + "has_more" ], - "title": "PreferenceOptimizeRequest" + "title": "VectorStoreSearchResponsePage", + "description": "Paginated response from searching a vector store." }, - "PostTrainingJob": { + "Checkpoint": { "type": "object", "properties": { - "job_uuid": { - "type": "string" + "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": [ - "job_uuid" - ], - "title": "PostTrainingJob" - }, - "AlgorithmConfig": { - "oneOf": [ - { - "$ref": "#/components/schemas/LoraFinetuningConfig" - }, - { - "$ref": "#/components/schemas/QATFinetuningConfig" - } + "identifier", + "created_at", + "epoch", + "post_training_job_id", + "path" ], - "discriminator": { - "propertyName": "type", - "mapping": { - "LoRA": "#/components/schemas/LoraFinetuningConfig", - "QAT": "#/components/schemas/QATFinetuningConfig" - } - } + "title": "Checkpoint", + "description": "Checkpoint created during training runs." }, - "LoraFinetuningConfig": { + "PostTrainingJobArtifactsResponse": { "type": "object", "properties": { - "type": { + "job_uuid": { "type": "string", - "const": "LoRA", - "default": "LoRA", - "description": "Algorithm type identifier, always \"LoRA\"" + "description": "Unique identifier for the training job" }, - "lora_attn_modules": { + "checkpoints": { "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/Checkpoint" }, - "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": { + "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": "Rank of the LoRA adaptation (lower rank = fewer parameters)" + "description": "Training epoch number" }, - "alpha": { - "type": "integer", - "description": "LoRA scaling parameter that controls adaptation strength" + "train_loss": { + "type": "number", + "description": "Loss value on the training dataset" }, - "use_dora": { - "type": "boolean", - "default": false, - "description": "(Optional) Whether to use DoRA (Weight-Decomposed Low-Rank Adaptation)" + "validation_loss": { + "type": "number", + "description": "Loss value on the validation dataset" }, - "quantize_base": { - "type": "boolean", - "default": false, - "description": "(Optional) Whether to quantize the base model weights" + "perplexity": { + "type": "number", + "description": "Perplexity metric indicating model confidence" } }, "additionalProperties": false, "required": [ - "type", - "lora_attn_modules", - "apply_lora_to_mlp", - "apply_lora_to_output", - "rank", - "alpha" + "epoch", + "train_loss", + "validation_loss", + "perplexity" ], - "title": "LoraFinetuningConfig", - "description": "Configuration for Low-Rank Adaptation (LoRA) fine-tuning." + "title": "PostTrainingMetric", + "description": "Training metrics captured during post-training jobs." }, - "QATFinetuningConfig": { + "CancelTrainingJobRequest": { "type": "object", "properties": { - "type": { - "type": "string", - "const": "QAT", - "default": "QAT", - "description": "Algorithm type identifier, always \"QAT\"" - }, - "quantizer_name": { + "job_uuid": { "type": "string", - "description": "Name of the quantization algorithm to use" - }, - "group_size": { - "type": "integer", - "description": "Size of groups for grouped quantization" + "description": "The UUID of the job to cancel." } }, "additionalProperties": false, "required": [ - "type", - "quantizer_name", - "group_size" + "job_uuid" ], - "title": "QATFinetuningConfig", - "description": "Configuration for Quantization-Aware Training (QAT) fine-tuning." + "title": "CancelTrainingJobRequest" }, - "SupervisedFineTuneRequest": { + "PostTrainingJobStatusResponse": { "type": "object", "properties": { "job_uuid": { "type": "string", - "description": "The UUID of the job to create." + "description": "Unique identifier for the training job" }, - "training_config": { - "$ref": "#/components/schemas/TrainingConfig", - "description": "The training configuration." + "status": { + "type": "string", + "enum": [ + "completed", + "in_progress", + "failed", + "scheduled", + "cancelled" + ], + "description": "Current status of the training job" }, - "hyperparam_search_config": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "The hyperparam search configuration." + "scheduled_at": { + "type": "string", + "format": "date-time", + "description": "(Optional) Timestamp when the job was scheduled" }, - "logger_config": { + "started_at": { + "type": "string", + "format": "date-time", + "description": "(Optional) Timestamp when the job execution began" + }, + "completed_at": { + "type": "string", + "format": "date-time", + "description": "(Optional) Timestamp when the job finished, if completed" + }, + "resources_allocated": { "type": "object", "additionalProperties": { "oneOf": [ @@ -13645,309 +12806,303 @@ { "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." + { + "type": "object" + } + ] + }, + "description": "(Optional) Information about computational resources allocated to the job" }, - "algorithm_config": { - "$ref": "#/components/schemas/AlgorithmConfig", - "description": "The algorithm configuration." + "checkpoints": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Checkpoint" + }, + "description": "List of model checkpoints created during training" } }, "additionalProperties": false, "required": [ "job_uuid", - "training_config", - "hyperparam_search_config", - "logger_config" + "status", + "checkpoints" ], - "title": "SupervisedFineTuneRequest" + "title": "PostTrainingJobStatusResponse", + "description": "Status of a finetuning job." }, - "QueryMetricsRequest": { + "ListPostTrainingJobsResponse": { "type": "object", "properties": { - "start_time": { - "type": "integer", - "description": "The start time of the metric to query." - }, - "end_time": { - "type": "integer", - "description": "The end time of the metric to query." - }, - "granularity": { - "type": "string", - "description": "The granularity of the metric to query." - }, - "query_type": { - "type": "string", - "enum": [ - "range", - "instant" - ], - "description": "The type of query to perform." - }, - "label_matchers": { + "data": { "type": "array", "items": { "type": "object", "properties": { - "name": { - "type": "string", - "description": "The name of the label to match" - }, - "value": { - "type": "string", - "description": "The value to match against" - }, - "operator": { - "type": "string", - "enum": [ - "=", - "!=", - "=~", - "!~" - ], - "description": "The comparison operator to use for matching", - "default": "=" + "job_uuid": { + "type": "string" } }, "additionalProperties": false, "required": [ - "name", - "value", - "operator" + "job_uuid" ], - "title": "MetricLabelMatcher", - "description": "A matcher for filtering metrics by label values." - }, - "description": "The label matchers to apply to the metric." + "title": "PostTrainingJob" + } } }, "additionalProperties": false, "required": [ - "start_time", - "query_type" + "data" ], - "title": "QueryMetricsRequest" + "title": "ListPostTrainingJobsResponse" }, - "MetricDataPoint": { + "DPOAlignmentConfig": { "type": "object", "properties": { - "timestamp": { - "type": "integer", - "description": "Unix timestamp when the metric value was recorded" - }, - "value": { + "beta": { "type": "number", - "description": "The numeric value of the metric at this timestamp" + "description": "Temperature parameter for the DPO loss" }, - "unit": { - "type": "string" + "loss_type": { + "$ref": "#/components/schemas/DPOLossType", + "default": "sigmoid", + "description": "The type of loss function to use for DPO" } }, "additionalProperties": false, "required": [ - "timestamp", - "value", - "unit" + "beta", + "loss_type" + ], + "title": "DPOAlignmentConfig", + "description": "Configuration for Direct Preference Optimization (DPO) alignment." + }, + "DPOLossType": { + "type": "string", + "enum": [ + "sigmoid", + "hinge", + "ipo", + "kto_pair" ], - "title": "MetricDataPoint", - "description": "A single data point in a metric time series." + "title": "DPOLossType" }, - "MetricLabel": { + "DataConfig": { "type": "object", "properties": { - "name": { + "dataset_id": { "type": "string", - "description": "The name of the label" + "description": "Unique identifier for the training dataset" }, - "value": { - "type": "string", - "description": "The value of the label" - } - }, - "additionalProperties": false, - "required": [ - "name", - "value" - ], - "title": "MetricLabel", - "description": "A label associated with a metric." - }, - "MetricSeries": { - "type": "object", - "properties": { - "metric": { + "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": "The name of the metric" + "description": "(Optional) Unique identifier for the validation dataset" }, - "labels": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MetricLabel" - }, - "description": "List of labels associated with this metric series" + "packed": { + "type": "boolean", + "default": false, + "description": "(Optional) Whether to pack multiple samples into a single sequence for efficiency" }, - "values": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MetricDataPoint" - }, - "description": "List of data points in chronological order" + "train_on_input": { + "type": "boolean", + "default": false, + "description": "(Optional) Whether to compute loss on input tokens as well as output tokens" } }, "additionalProperties": false, "required": [ - "metric", - "labels", - "values" + "dataset_id", + "batch_size", + "shuffle", + "data_format" + ], + "title": "DataConfig", + "description": "Configuration for training data and data loading." + }, + "DatasetFormat": { + "type": "string", + "enum": [ + "instruct", + "dialog" ], - "title": "MetricSeries", - "description": "A time series of metric data points." + "title": "DatasetFormat", + "description": "Format of the training dataset." }, - "QueryMetricsResponse": { + "EfficiencyConfig": { "type": "object", "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MetricSeries" - }, - "description": "List of metric series matching the query criteria" + "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, - "required": [ - "data" - ], - "title": "QueryMetricsResponse", - "description": "Response containing metric time series data." + "title": "EfficiencyConfig", + "description": "Configuration for memory and compute efficiency optimizations." }, - "QueryCondition": { + "OptimizerConfig": { "type": "object", "properties": { - "key": { - "type": "string", - "description": "The attribute key to filter on" + "optimizer_type": { + "$ref": "#/components/schemas/OptimizerType", + "description": "Type of optimizer to use (adam, adamw, or sgd)" }, - "op": { - "$ref": "#/components/schemas/QueryConditionOp", - "description": "The comparison operator to apply" + "lr": { + "type": "number", + "description": "Learning rate for the optimizer" }, - "value": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ], - "description": "The value to compare against" + "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": [ - "key", - "op", - "value" + "optimizer_type", + "lr", + "weight_decay", + "num_warmup_steps" ], - "title": "QueryCondition", - "description": "A condition for filtering query results." + "title": "OptimizerConfig", + "description": "Configuration parameters for the optimization algorithm." }, - "QueryConditionOp": { + "OptimizerType": { "type": "string", "enum": [ - "eq", - "ne", - "gt", - "lt" + "adam", + "adamw", + "sgd" ], - "title": "QueryConditionOp", - "description": "Comparison operators for query conditions." + "title": "OptimizerType", + "description": "Available optimizer algorithms for training." }, - "QuerySpansRequest": { + "TrainingConfig": { "type": "object", "properties": { - "attribute_filters": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QueryCondition" - }, - "description": "The attribute filters to apply to the spans." + "n_epochs": { + "type": "integer", + "description": "Number of training epochs to run" }, - "attributes_to_return": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The attributes to return in the spans." + "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_depth": { + "max_validation_steps": { "type": "integer", - "description": "The maximum depth of the tree." + "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": [ - "attribute_filters", - "attributes_to_return" + "n_epochs", + "max_steps_per_epoch", + "gradient_accumulation_steps" ], - "title": "QuerySpansRequest" + "title": "TrainingConfig", + "description": "Comprehensive configuration for the training process." }, - "Span": { + "PreferenceOptimizeRequest": { "type": "object", "properties": { - "span_id": { - "type": "string", - "description": "Unique identifier for the span" - }, - "trace_id": { + "job_uuid": { "type": "string", - "description": "Unique identifier for the trace this span belongs to" + "description": "The UUID of the job to create." }, - "parent_span_id": { + "finetuned_model": { "type": "string", - "description": "(Optional) Unique identifier for the parent span, if this is a child span" + "description": "The model to fine-tune." }, - "name": { - "type": "string", - "description": "Human-readable name describing the operation this span represents" + "algorithm_config": { + "$ref": "#/components/schemas/DPOAlignmentConfig", + "description": "The algorithm configuration." }, - "start_time": { - "type": "string", - "format": "date-time", - "description": "Timestamp when the operation began" + "training_config": { + "$ref": "#/components/schemas/TrainingConfig", + "description": "The training configuration." }, - "end_time": { - "type": "string", - "format": "date-time", - "description": "(Optional) Timestamp when the operation finished, if completed" + "hyperparam_search_config": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + }, + "description": "The hyperparam search configuration." }, - "attributes": { + "logger_config": { "type": "object", "additionalProperties": { "oneOf": [ @@ -13971,128 +13126,144 @@ } ] }, - "description": "(Optional) Key-value pairs containing additional metadata about the span" + "description": "The logger configuration." } }, "additionalProperties": false, "required": [ - "span_id", - "trace_id", - "name", - "start_time" + "job_uuid", + "finetuned_model", + "algorithm_config", + "training_config", + "hyperparam_search_config", + "logger_config" ], - "title": "Span", - "description": "A span representing a single operation within a trace." + "title": "PreferenceOptimizeRequest" }, - "QuerySpansResponse": { + "PostTrainingJob": { "type": "object", "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Span" - }, - "description": "List of spans matching the query criteria" + "job_uuid": { + "type": "string" } }, "additionalProperties": false, "required": [ - "data" + "job_uuid" + ], + "title": "PostTrainingJob" + }, + "AlgorithmConfig": { + "oneOf": [ + { + "$ref": "#/components/schemas/LoraFinetuningConfig" + }, + { + "$ref": "#/components/schemas/QATFinetuningConfig" + } ], - "title": "QuerySpansResponse", - "description": "Response containing a list of spans." + "discriminator": { + "propertyName": "type", + "mapping": { + "LoRA": "#/components/schemas/LoraFinetuningConfig", + "QAT": "#/components/schemas/QATFinetuningConfig" + } + } }, - "SaveSpansToDatasetRequest": { + "LoraFinetuningConfig": { "type": "object", "properties": { - "attribute_filters": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QueryCondition" - }, - "description": "The attribute filters to apply to the spans." + "type": { + "type": "string", + "const": "LoRA", + "default": "LoRA", + "description": "Algorithm type identifier, always \"LoRA\"" }, - "attributes_to_save": { + "lora_attn_modules": { "type": "array", "items": { "type": "string" }, - "description": "The attributes to save to the dataset." + "description": "List of attention module names to apply LoRA to" }, - "dataset_id": { - "type": "string", - "description": "The ID of the dataset to save the spans 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)" }, - "max_depth": { + "alpha": { "type": "integer", - "description": "The maximum depth of the tree." + "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": [ - "attribute_filters", - "attributes_to_save", - "dataset_id" + "type", + "lora_attn_modules", + "apply_lora_to_mlp", + "apply_lora_to_output", + "rank", + "alpha" ], - "title": "SaveSpansToDatasetRequest" + "title": "LoraFinetuningConfig", + "description": "Configuration for Low-Rank Adaptation (LoRA) fine-tuning." }, - "GetSpanTreeRequest": { + "QATFinetuningConfig": { "type": "object", "properties": { - "attributes_to_return": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The attributes to return in the tree." + "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" }, - "max_depth": { + "group_size": { "type": "integer", - "description": "The maximum depth of the tree." + "description": "Size of groups for grouped quantization" } }, "additionalProperties": false, - "title": "GetSpanTreeRequest" - }, - "SpanStatus": { - "type": "string", - "enum": [ - "ok", - "error" + "required": [ + "type", + "quantizer_name", + "group_size" ], - "title": "SpanStatus", - "description": "The status of a span indicating whether it completed successfully or with an error." + "title": "QATFinetuningConfig", + "description": "Configuration for Quantization-Aware Training (QAT) fine-tuning." }, - "SpanWithStatus": { + "SupervisedFineTuneRequest": { "type": "object", "properties": { - "span_id": { - "type": "string", - "description": "Unique identifier for the span" - }, - "trace_id": { - "type": "string", - "description": "Unique identifier for the trace this span belongs to" - }, - "parent_span_id": { - "type": "string", - "description": "(Optional) Unique identifier for the parent span, if this is a child span" - }, - "name": { - "type": "string", - "description": "Human-readable name describing the operation this span represents" - }, - "start_time": { + "job_uuid": { "type": "string", - "format": "date-time", - "description": "Timestamp when the operation began" + "description": "The UUID of the job to create." }, - "end_time": { - "type": "string", - "format": "date-time", - "description": "(Optional) Timestamp when the operation finished, if completed" + "training_config": { + "$ref": "#/components/schemas/TrainingConfig", + "description": "The training configuration." }, - "attributes": { + "hyperparam_search_config": { "type": "object", "additionalProperties": { "oneOf": [ @@ -14116,118 +13287,55 @@ } ] }, - "description": "(Optional) Key-value pairs containing additional metadata about the span" + "description": "The hyperparam search configuration." }, - "status": { - "$ref": "#/components/schemas/SpanStatus", - "description": "(Optional) The current status of the span" - } - }, - "additionalProperties": false, - "required": [ - "span_id", - "trace_id", - "name", - "start_time" - ], - "title": "SpanWithStatus", - "description": "A span that includes status information." - }, - "QuerySpanTreeResponse": { - "type": "object", - "properties": { - "data": { + "logger_config": { "type": "object", "additionalProperties": { - "$ref": "#/components/schemas/SpanWithStatus" - }, - "description": "Dictionary mapping span IDs to spans with status information" - } - }, - "additionalProperties": false, - "required": [ - "data" - ], - "title": "QuerySpanTreeResponse", - "description": "Response containing a tree structure of spans." - }, - "QueryTracesRequest": { - "type": "object", - "properties": { - "attribute_filters": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QueryCondition" - }, - "description": "The attribute filters to apply to the traces." - }, - "limit": { - "type": "integer", - "description": "The limit of traces to return." - }, - "offset": { - "type": "integer", - "description": "The offset of the traces to return." - }, - "order_by": { - "type": "array", - "items": { - "type": "string" + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] }, - "description": "The order by of the traces to return." - } - }, - "additionalProperties": false, - "title": "QueryTracesRequest" - }, - "Trace": { - "type": "object", - "properties": { - "trace_id": { - "type": "string", - "description": "Unique identifier for the trace" + "description": "The logger configuration." }, - "root_span_id": { + "model": { "type": "string", - "description": "Unique identifier for the root span that started this trace" + "description": "The model to fine-tune." }, - "start_time": { + "checkpoint_dir": { "type": "string", - "format": "date-time", - "description": "Timestamp when the trace began" + "description": "The directory to save checkpoint(s) to." }, - "end_time": { - "type": "string", - "format": "date-time", - "description": "(Optional) Timestamp when the trace finished, if completed" - } - }, - "additionalProperties": false, - "required": [ - "trace_id", - "root_span_id", - "start_time" - ], - "title": "Trace", - "description": "A trace representing the complete execution path of a request across multiple operations." - }, - "QueryTracesResponse": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Trace" - }, - "description": "List of traces matching the query criteria" + "algorithm_config": { + "$ref": "#/components/schemas/AlgorithmConfig", + "description": "The algorithm configuration." } }, "additionalProperties": false, "required": [ - "data" + "job_uuid", + "training_config", + "hyperparam_search_config", + "logger_config" ], - "title": "QueryTracesResponse", - "description": "Response containing a list of traces." + "title": "SupervisedFineTuneRequest" } }, "responses": { @@ -14344,10 +13452,6 @@ "description": "OpenAI-compatible Moderations API.", "x-displayName": "Safety" }, - { - "name": "Telemetry", - "description": "" - }, { "name": "VectorIO", "description": "" @@ -14367,7 +13471,6 @@ "Models", "PostTraining (Coming Soon)", "Safety", - "Telemetry", "VectorIO" ] } diff --git a/docs/static/deprecated-llama-stack-spec.yaml b/docs/static/deprecated-llama-stack-spec.yaml index ffdfd8bc7c..ef388e5d16 100644 --- a/docs/static/deprecated-llama-stack-spec.yaml +++ b/docs/static/deprecated-llama-stack-spec.yaml @@ -2600,238 +2600,6 @@ paths: $ref: '#/components/schemas/SupervisedFineTuneRequest' required: true deprecated: true - /v1/telemetry/metrics/{metric_name}: - post: - responses: - '200': - description: A QueryMetricsResponse. - content: - application/json: - schema: - $ref: '#/components/schemas/QueryMetricsResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Telemetry - summary: Query metrics. - description: Query metrics. - parameters: - - name: metric_name - in: path - description: The name of the metric to query. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QueryMetricsRequest' - required: true - deprecated: true - /v1/telemetry/spans: - post: - responses: - '200': - description: A QuerySpansResponse. - content: - application/json: - schema: - $ref: '#/components/schemas/QuerySpansResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Telemetry - summary: Query spans. - description: Query spans. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QuerySpansRequest' - required: true - deprecated: true - /v1/telemetry/spans/export: - 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: - - Telemetry - summary: Save spans to a dataset. - description: Save spans to a dataset. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SaveSpansToDatasetRequest' - required: true - deprecated: true - /v1/telemetry/spans/{span_id}/tree: - post: - responses: - '200': - description: A QuerySpanTreeResponse. - content: - application/json: - schema: - $ref: '#/components/schemas/QuerySpanTreeResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Telemetry - summary: Get a span tree by its ID. - description: Get a span tree by its ID. - parameters: - - name: span_id - in: path - description: The ID of the span to get the tree from. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetSpanTreeRequest' - required: true - deprecated: true - /v1/telemetry/traces: - post: - responses: - '200': - description: A QueryTracesResponse. - content: - application/json: - schema: - $ref: '#/components/schemas/QueryTracesResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Telemetry - summary: Query traces. - description: Query traces. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QueryTracesRequest' - required: true - deprecated: true - /v1/telemetry/traces/{trace_id}: - get: - responses: - '200': - description: A Trace. - content: - application/json: - schema: - $ref: '#/components/schemas/Trace' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Telemetry - summary: Get a trace by its ID. - description: Get a trace by its ID. - parameters: - - name: trace_id - in: path - description: The ID of the trace to get. - required: true - schema: - type: string - deprecated: true - /v1/telemetry/traces/{trace_id}/spans/{span_id}: - get: - responses: - '200': - description: A Span. - content: - application/json: - schema: - $ref: '#/components/schemas/Span' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Telemetry - summary: Get a span by its ID. - description: Get a span by its ID. - parameters: - - name: trace_id - in: path - description: >- - The ID of the trace to get the span from. - required: true - schema: - type: string - - name: span_id - in: path - description: The ID of the span to get. - required: true - schema: - type: string - deprecated: true jsonSchemaDialect: >- https://json-schema.org/draft/2020-12/schema components: @@ -10341,434 +10109,6 @@ components: - hyperparam_search_config - logger_config title: SupervisedFineTuneRequest - QueryMetricsRequest: - type: object - properties: - start_time: - type: integer - description: The start time of the metric to query. - end_time: - type: integer - description: The end time of the metric to query. - granularity: - type: string - description: The granularity of the metric to query. - query_type: - type: string - enum: - - range - - instant - description: The type of query to perform. - label_matchers: - type: array - items: - type: object - properties: - name: - type: string - description: The name of the label to match - value: - type: string - description: The value to match against - operator: - type: string - enum: - - '=' - - '!=' - - =~ - - '!~' - description: >- - The comparison operator to use for matching - default: '=' - additionalProperties: false - required: - - name - - value - - operator - title: MetricLabelMatcher - description: >- - A matcher for filtering metrics by label values. - description: >- - The label matchers to apply to the metric. - additionalProperties: false - required: - - start_time - - query_type - title: QueryMetricsRequest - MetricDataPoint: - type: object - properties: - timestamp: - type: integer - description: >- - Unix timestamp when the metric value was recorded - value: - type: number - description: >- - The numeric value of the metric at this timestamp - unit: - type: string - additionalProperties: false - required: - - timestamp - - value - - unit - title: MetricDataPoint - description: >- - A single data point in a metric time series. - MetricLabel: - type: object - properties: - name: - type: string - description: The name of the label - value: - type: string - description: The value of the label - additionalProperties: false - required: - - name - - value - title: MetricLabel - description: A label associated with a metric. - MetricSeries: - type: object - properties: - metric: - type: string - description: The name of the metric - labels: - type: array - items: - $ref: '#/components/schemas/MetricLabel' - description: >- - List of labels associated with this metric series - values: - type: array - items: - $ref: '#/components/schemas/MetricDataPoint' - description: >- - List of data points in chronological order - additionalProperties: false - required: - - metric - - labels - - values - title: MetricSeries - description: A time series of metric data points. - QueryMetricsResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/MetricSeries' - description: >- - List of metric series matching the query criteria - additionalProperties: false - required: - - data - title: QueryMetricsResponse - description: >- - Response containing metric time series data. - QueryCondition: - type: object - properties: - key: - type: string - description: The attribute key to filter on - op: - $ref: '#/components/schemas/QueryConditionOp' - description: The comparison operator to apply - value: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The value to compare against - additionalProperties: false - required: - - key - - op - - value - title: QueryCondition - description: A condition for filtering query results. - QueryConditionOp: - type: string - enum: - - eq - - ne - - gt - - lt - title: QueryConditionOp - description: >- - Comparison operators for query conditions. - QuerySpansRequest: - type: object - properties: - attribute_filters: - type: array - items: - $ref: '#/components/schemas/QueryCondition' - description: >- - The attribute filters to apply to the spans. - attributes_to_return: - type: array - items: - type: string - description: The attributes to return in the spans. - max_depth: - type: integer - description: The maximum depth of the tree. - additionalProperties: false - required: - - attribute_filters - - attributes_to_return - title: QuerySpansRequest - Span: - type: object - properties: - span_id: - type: string - description: Unique identifier for the span - trace_id: - type: string - description: >- - Unique identifier for the trace this span belongs to - parent_span_id: - type: string - description: >- - (Optional) Unique identifier for the parent span, if this is a child span - name: - type: string - description: >- - Human-readable name describing the operation this span represents - start_time: - type: string - format: date-time - description: Timestamp when the operation began - end_time: - type: string - format: date-time - description: >- - (Optional) Timestamp when the operation finished, if completed - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Key-value pairs containing additional metadata about the span - additionalProperties: false - required: - - span_id - - trace_id - - name - - start_time - title: Span - description: >- - A span representing a single operation within a trace. - QuerySpansResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/Span' - description: >- - List of spans matching the query criteria - additionalProperties: false - required: - - data - title: QuerySpansResponse - description: Response containing a list of spans. - SaveSpansToDatasetRequest: - type: object - properties: - attribute_filters: - type: array - items: - $ref: '#/components/schemas/QueryCondition' - description: >- - The attribute filters to apply to the spans. - attributes_to_save: - type: array - items: - type: string - description: The attributes to save to the dataset. - dataset_id: - type: string - description: >- - The ID of the dataset to save the spans to. - max_depth: - type: integer - description: The maximum depth of the tree. - additionalProperties: false - required: - - attribute_filters - - attributes_to_save - - dataset_id - title: SaveSpansToDatasetRequest - GetSpanTreeRequest: - type: object - properties: - attributes_to_return: - type: array - items: - type: string - description: The attributes to return in the tree. - max_depth: - type: integer - description: The maximum depth of the tree. - additionalProperties: false - title: GetSpanTreeRequest - SpanStatus: - type: string - enum: - - ok - - error - title: SpanStatus - description: >- - The status of a span indicating whether it completed successfully or with - an error. - SpanWithStatus: - type: object - properties: - span_id: - type: string - description: Unique identifier for the span - trace_id: - type: string - description: >- - Unique identifier for the trace this span belongs to - parent_span_id: - type: string - description: >- - (Optional) Unique identifier for the parent span, if this is a child span - name: - type: string - description: >- - Human-readable name describing the operation this span represents - start_time: - type: string - format: date-time - description: Timestamp when the operation began - end_time: - type: string - format: date-time - description: >- - (Optional) Timestamp when the operation finished, if completed - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Key-value pairs containing additional metadata about the span - status: - $ref: '#/components/schemas/SpanStatus' - description: >- - (Optional) The current status of the span - additionalProperties: false - required: - - span_id - - trace_id - - name - - start_time - title: SpanWithStatus - description: A span that includes status information. - QuerySpanTreeResponse: - type: object - properties: - data: - type: object - additionalProperties: - $ref: '#/components/schemas/SpanWithStatus' - description: >- - Dictionary mapping span IDs to spans with status information - additionalProperties: false - required: - - data - title: QuerySpanTreeResponse - description: >- - Response containing a tree structure of spans. - QueryTracesRequest: - type: object - properties: - attribute_filters: - type: array - items: - $ref: '#/components/schemas/QueryCondition' - description: >- - The attribute filters to apply to the traces. - limit: - type: integer - description: The limit of traces to return. - offset: - type: integer - description: The offset of the traces to return. - order_by: - type: array - items: - type: string - description: The order by of the traces to return. - additionalProperties: false - title: QueryTracesRequest - Trace: - type: object - properties: - trace_id: - type: string - description: Unique identifier for the trace - root_span_id: - type: string - description: >- - Unique identifier for the root span that started this trace - start_time: - type: string - format: date-time - description: Timestamp when the trace began - end_time: - type: string - format: date-time - description: >- - (Optional) Timestamp when the trace finished, if completed - additionalProperties: false - required: - - trace_id - - root_span_id - - start_time - title: Trace - description: >- - A trace representing the complete execution path of a request across multiple - operations. - QueryTracesResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/Trace' - description: >- - List of traces matching the query criteria - additionalProperties: false - required: - - data - title: QueryTracesResponse - description: Response containing a list of traces. responses: BadRequest400: description: The request was invalid or malformed @@ -10874,8 +10214,6 @@ tags: - name: Safety description: OpenAI-compatible Moderations API. x-displayName: Safety - - name: Telemetry - description: '' - name: VectorIO description: '' x-tagGroups: @@ -10891,5 +10229,4 @@ x-tagGroups: - Models - PostTraining (Coming Soon) - Safety - - Telemetry - VectorIO diff --git a/docs/static/experimental-llama-stack-spec.html b/docs/static/experimental-llama-stack-spec.html index a84226c05a..e3edf2ffcf 100644 --- a/docs/static/experimental-llama-stack-spec.html +++ b/docs/static/experimental-llama-stack-spec.html @@ -1711,1142 +1711,183 @@ }, "deprecated": false } - }, - "/v1alpha/telemetry/metrics/{metric_name}": { - "post": { - "responses": { - "200": { - "description": "A QueryMetricsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryMetricsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "$ref": "#/components/responses/DefaultError" - } - }, - "tags": [ - "Telemetry" - ], - "summary": "Query metrics.", - "description": "Query metrics.", - "parameters": [ - { - "name": "metric_name", - "in": "path", - "description": "The name of the metric to query.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryMetricsRequest" - } - } - }, - "required": true - }, - "deprecated": false - } - }, - "/v1alpha/telemetry/spans": { - "post": { - "responses": { - "200": { - "description": "A QuerySpansResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QuerySpansResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "$ref": "#/components/responses/DefaultError" - } - }, - "tags": [ - "Telemetry" - ], - "summary": "Query spans.", - "description": "Query spans.", - "parameters": [], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QuerySpansRequest" - } - } - }, - "required": true - }, - "deprecated": false - } - }, - "/v1alpha/telemetry/spans/export": { - "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": [ - "Telemetry" - ], - "summary": "Save spans to a dataset.", - "description": "Save spans to a dataset.", - "parameters": [], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SaveSpansToDatasetRequest" - } - } - }, - "required": true - }, - "deprecated": false - } - }, - "/v1alpha/telemetry/spans/{span_id}/tree": { - "post": { - "responses": { - "200": { - "description": "A QuerySpanTreeResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QuerySpanTreeResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "$ref": "#/components/responses/DefaultError" - } - }, - "tags": [ - "Telemetry" - ], - "summary": "Get a span tree by its ID.", - "description": "Get a span tree by its ID.", - "parameters": [ - { - "name": "span_id", - "in": "path", - "description": "The ID of the span to get the tree from.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetSpanTreeRequest" - } - } - }, - "required": true - }, - "deprecated": false - } - }, - "/v1alpha/telemetry/traces": { - "post": { - "responses": { - "200": { - "description": "A QueryTracesResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryTracesResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "$ref": "#/components/responses/DefaultError" - } - }, - "tags": [ - "Telemetry" - ], - "summary": "Query traces.", - "description": "Query traces.", - "parameters": [], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryTracesRequest" - } - } - }, - "required": true - }, - "deprecated": false - } - }, - "/v1alpha/telemetry/traces/{trace_id}": { - "get": { - "responses": { - "200": { - "description": "A Trace.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Trace" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "$ref": "#/components/responses/DefaultError" - } - }, - "tags": [ - "Telemetry" - ], - "summary": "Get a trace by its ID.", - "description": "Get a trace by its ID.", - "parameters": [ - { - "name": "trace_id", - "in": "path", - "description": "The ID of the trace to get.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "deprecated": false - } - }, - "/v1alpha/telemetry/traces/{trace_id}/spans/{span_id}": { - "get": { - "responses": { - "200": { - "description": "A Span.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Span" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "$ref": "#/components/responses/DefaultError" - } - }, - "tags": [ - "Telemetry" - ], - "summary": "Get a span by its ID.", - "description": "Get a span by its ID.", - "parameters": [ - { - "name": "trace_id", - "in": "path", - "description": "The ID of the trace to get the span from.", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "span_id", - "in": "path", - "description": "The ID of the span to get.", - "required": true, - "schema": { - "type": "string" - } - } - ], - "deprecated": false - } - } - }, - "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema", - "components": { - "schemas": { - "Error": { - "type": "object", - "properties": { - "status": { - "type": "integer", - "description": "HTTP status code" - }, - "title": { - "type": "string", - "description": "Error title, a short summary of the error which is invariant for an error type" - }, - "detail": { - "type": "string", - "description": "Error detail, a longer human-readable description of the error" - }, - "instance": { - "type": "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": { - "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", - "properties": { - "identifier": { - "type": "string" - }, - "provider_resource_id": { - "type": "string" - }, - "provider_id": { - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "model", - "shield", - "vector_db", - "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" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "Additional metadata for the dataset" - } - }, - "additionalProperties": false, - "required": [ - "identifier", - "provider_id", - "type", - "purpose", - "source", - "metadata" - ], - "title": "Dataset", - "description": "Dataset resource for storing and accessing training or evaluation data." - }, - "RowsDataSource": { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "rows", - "default": "rows" - }, - "rows": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - } - }, - "description": "The dataset is stored in rows. E.g. - [ {\"messages\": [{\"role\": \"user\", \"content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello, world!\"}]} ]" - } - }, - "additionalProperties": false, - "required": [ - "type", - "rows" - ], - "title": "RowsDataSource", - "description": "A dataset stored in rows." - }, - "URIDataSource": { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "uri", - "default": "uri" - }, - "uri": { - "type": "string", - "description": "The dataset can be obtained from a URI. E.g. - \"https://mywebsite.com/mydata.jsonl\" - \"lsfs://mydata.jsonl\" - \"data:csv;base64,{base64_content}\"" - } - }, - "additionalProperties": false, - "required": [ - "type", - "uri" - ], - "title": "URIDataSource", - "description": "A dataset that can be obtained from a URI." - }, - "ListDatasetsResponse": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Dataset" - }, - "description": "List of datasets" - } - }, - "additionalProperties": false, - "required": [ - "data" - ], - "title": "ListDatasetsResponse", - "description": "Response from listing datasets." - }, - "DataSource": { - "oneOf": [ - { - "$ref": "#/components/schemas/URIDataSource" - }, - { - "$ref": "#/components/schemas/RowsDataSource" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "uri": "#/components/schemas/URIDataSource", - "rows": "#/components/schemas/RowsDataSource" - } - } - }, - "RegisterDatasetRequest": { - "type": "object", - "properties": { - "purpose": { - "type": "string", - "enum": [ - "post-training/messages", - "eval/question-answer", - "eval/messages-answer" - ], - "description": "The purpose of the dataset. One of: - \"post-training/messages\": The dataset contains a messages column with list of messages for post-training. { \"messages\": [ {\"role\": \"user\", \"content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello, world!\"}, ] } - \"eval/question-answer\": The dataset contains a question column and an answer column for evaluation. { \"question\": \"What is the capital of France?\", \"answer\": \"Paris\" } - \"eval/messages-answer\": The dataset contains a messages column with list of messages and an answer column for evaluation. { \"messages\": [ {\"role\": \"user\", \"content\": \"Hello, my name is John Doe.\"}, {\"role\": \"assistant\", \"content\": \"Hello, John Doe. How can I help you today?\"}, {\"role\": \"user\", \"content\": \"What's my name?\"}, ], \"answer\": \"John Doe\" }" - }, - "source": { - "$ref": "#/components/schemas/DataSource", - "description": "The data source of the dataset. Ensure that the data source schema is compatible with the purpose of the dataset. Examples: - { \"type\": \"uri\", \"uri\": \"https://mywebsite.com/mydata.jsonl\" } - { \"type\": \"uri\", \"uri\": \"lsfs://mydata.jsonl\" } - { \"type\": \"uri\", \"uri\": \"data:csv;base64,{base64_content}\" } - { \"type\": \"uri\", \"uri\": \"huggingface://llamastack/simpleqa?split=train\" } - { \"type\": \"rows\", \"rows\": [ { \"messages\": [ {\"role\": \"user\", \"content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello, world!\"}, ] } ] }" - }, - "metadata": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "The metadata for the dataset. - E.g. {\"description\": \"My dataset\"}." - }, - "dataset_id": { - "type": "string", - "description": "The ID of the dataset. If not provided, an ID will be generated." - } - }, - "additionalProperties": false, - "required": [ - "purpose", - "source" - ], - "title": "RegisterDatasetRequest" - }, - "AgentConfig": { + } + }, + "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema", + "components": { + "schemas": { + "Error": { "type": "object", "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": { + "status": { "type": "integer", - "default": 10 - }, - "model": { - "type": "string", - "description": "The model identifier to use for the agent" - }, - "instructions": { - "type": "string", - "description": "The system instructions for the agent" - }, - "name": { - "type": "string", - "description": "Optional name for the agent, used in telemetry and identification" - }, - "enable_session_persistence": { - "type": "boolean", - "default": false, - "description": "Optional flag indicating whether session data has to be persisted" - }, - "response_format": { - "$ref": "#/components/schemas/ResponseFormat", - "description": "Optional response format configuration" - } - }, - "additionalProperties": false, - "required": [ - "model", - "instructions" - ], - "title": "AgentConfig", - "description": "Configuration for an agent." - }, - "AgentTool": { - "oneOf": [ - { - "type": "string" + "description": "HTTP status code" }, - { - "type": "object", - "properties": { - "name": { - "type": "string" - }, - "args": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - } - } - }, - "additionalProperties": false, - "required": [ - "name", - "args" - ], - "title": "AgentToolGroupWithArgs" - } - ] - }, - "GrammarResponseFormat": { - "type": "object", - "properties": { - "type": { + "title": { "type": "string", - "enum": [ - "json_schema", - "grammar" - ], - "description": "Must be \"grammar\" to identify this format type", - "const": "grammar", - "default": "grammar" + "description": "Error title, a short summary of the error which is invariant for an error type" }, - "bnf": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "The BNF grammar specification the response should conform to" - } - }, - "additionalProperties": false, - "required": [ - "type", - "bnf" - ], - "title": "GrammarResponseFormat", - "description": "Configuration for grammar-guided response generation." - }, - "GreedySamplingStrategy": { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "greedy", - "default": "greedy", - "description": "Must be \"greedy\" to identify this sampling strategy" - } - }, - "additionalProperties": false, - "required": [ - "type" - ], - "title": "GreedySamplingStrategy", - "description": "Greedy sampling strategy that selects the highest probability token at each step." - }, - "JsonSchemaResponseFormat": { - "type": "object", - "properties": { - "type": { + "detail": { "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" + "description": "Error detail, a longer human-readable description of the error" }, - { - "$ref": "#/components/schemas/GrammarResponseFormat" + "instance": { + "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" ], - "discriminator": { - "propertyName": "type", - "mapping": { - "json_schema": "#/components/schemas/JsonSchemaResponseFormat", - "grammar": "#/components/schemas/GrammarResponseFormat" - } - } + "title": "Error", + "description": "Error response from the API. Roughly follows RFC 7807." }, - "SamplingParams": { + "AppendRowsRequest": { "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", - "default": 0, - "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": { + "rows": { "type": "array", "items": { - "type": "string" + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + } }, - "description": "Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence." + "description": "The rows to append to the dataset." } }, "additionalProperties": false, "required": [ - "strategy" + "rows" ], - "title": "SamplingParams", - "description": "Sampling parameters." + "title": "AppendRowsRequest" }, - "ToolConfig": { + "PaginatedResponse": { "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" + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] } - ], - "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." + }, + "description": "The list of items for the current page" }, - "tool_prompt_format": { - "type": "string", - "enum": [ - "json", - "function_tag", - "python_list" - ], - "description": "(Optional) Instructs the model how to format tool calls. By default, Llama Stack will attempt to use a format that is best adapted to the model. - `ToolPromptFormat.json`: The tool calls are formatted as a JSON object. - `ToolPromptFormat.function_tag`: The tool calls are enclosed in a tag. - `ToolPromptFormat.python_list`: The tool calls are output as Python syntax -- a list of function calls." + "has_more": { + "type": "boolean", + "description": "Whether there are more items available after this set" }, - "system_message_behavior": { + "url": { "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" + "description": "The URL for accessing this list" } }, "additionalProperties": false, - "title": "ToolConfig", - "description": "Configuration for tool use." + "required": [ + "data", + "has_more" + ], + "title": "PaginatedResponse", + "description": "A generic paginated response that follows a simple format." }, - "ToolDef": { + "Dataset": { "type": "object", "properties": { - "toolgroup_id": { - "type": "string", - "description": "(Optional) ID of the tool group this tool belongs to" + "identifier": { + "type": "string" }, - "name": { - "type": "string", - "description": "Name of the tool" + "provider_resource_id": { + "type": "string" }, - "description": { + "provider_id": { + "type": "string" + }, + "type": { "type": "string", - "description": "(Optional) Human-readable description of what the tool does" + "enum": [ + "model", + "shield", + "vector_db", + "dataset", + "scoring_function", + "benchmark", + "tool", + "tool_group", + "prompt" + ], + "const": "dataset", + "default": "dataset", + "description": "Type of resource, always 'dataset' for datasets" }, - "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)" + "purpose": { + "type": "string", + "enum": [ + "post-training/messages", + "eval/question-answer", + "eval/messages-answer" + ], + "description": "Purpose of the dataset indicating its intended use" }, - "output_schema": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] + "source": { + "oneOf": [ + { + "$ref": "#/components/schemas/URIDataSource" + }, + { + "$ref": "#/components/schemas/RowsDataSource" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "uri": "#/components/schemas/URIDataSource", + "rows": "#/components/schemas/RowsDataSource" + } }, - "description": "(Optional) JSON Schema for tool outputs (MCP outputSchema)" + "description": "Data source configuration for the dataset" }, "metadata": { "type": "object", @@ -2872,369 +1913,326 @@ } ] }, - "description": "(Optional) Additional metadata about the tool" - } - }, - "additionalProperties": false, - "required": [ - "name" - ], - "title": "ToolDef", - "description": "Tool definition used in runtime contexts." - }, - "TopKSamplingStrategy": { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "top_k", - "default": "top_k", - "description": "Must be \"top_k\" to identify this sampling strategy" - }, - "top_k": { - "type": "integer", - "description": "Number of top tokens to consider for sampling. Must be at least 1" + "description": "Additional metadata for the dataset" } }, "additionalProperties": false, "required": [ + "identifier", + "provider_id", "type", - "top_k" + "purpose", + "source", + "metadata" ], - "title": "TopKSamplingStrategy", - "description": "Top-k sampling strategy that restricts sampling to the k most likely tokens." + "title": "Dataset", + "description": "Dataset resource for storing and accessing training or evaluation data." }, - "TopPSamplingStrategy": { + "RowsDataSource": { "type": "object", "properties": { "type": { "type": "string", - "const": "top_p", - "default": "top_p", - "description": "Must be \"top_p\" to identify this sampling strategy" - }, - "temperature": { - "type": "number", - "description": "Controls randomness in sampling. Higher values increase randomness" - }, - "top_p": { - "type": "number", - "default": 0.95, - "description": "Cumulative probability threshold for nucleus sampling. Defaults to 0.95" - } - }, - "additionalProperties": false, - "required": [ - "type" - ], - "title": "TopPSamplingStrategy", - "description": "Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p." - }, - "CreateAgentRequest": { - "type": "object", - "properties": { - "agent_config": { - "$ref": "#/components/schemas/AgentConfig", - "description": "The configuration for the agent." - } - }, - "additionalProperties": false, - "required": [ - "agent_config" - ], - "title": "CreateAgentRequest" - }, - "AgentCreateResponse": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique identifier for the created agent" - } - }, - "additionalProperties": false, - "required": [ - "agent_id" - ], - "title": "AgentCreateResponse", - "description": "Response returned when creating a new agent." - }, - "Agent": { - "type": "object", - "properties": { - "agent_id": { - "type": "string", - "description": "Unique identifier for the agent" - }, - "agent_config": { - "$ref": "#/components/schemas/AgentConfig", - "description": "Configuration settings for the agent" - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp when the agent was created" - } - }, - "additionalProperties": false, - "required": [ - "agent_id", - "agent_config", - "created_at" - ], - "title": "Agent", - "description": "An agent instance with configuration and metadata." - }, - "CreateAgentSessionRequest": { - "type": "object", - "properties": { - "session_name": { - "type": "string", - "description": "The name of the session to create." - } - }, - "additionalProperties": false, - "required": [ - "session_name" - ], - "title": "CreateAgentSessionRequest" - }, - "AgentSessionCreateResponse": { - "type": "object", - "properties": { - "session_id": { - "type": "string", - "description": "Unique identifier for the created session" - } - }, - "additionalProperties": false, - "required": [ - "session_id" - ], - "title": "AgentSessionCreateResponse", - "description": "Response returned when creating a new agent session." - }, - "CompletionMessage": { - "type": "object", - "properties": { - "role": { - "type": "string", - "const": "assistant", - "default": "assistant", - "description": "Must be \"assistant\" to identify this as the model's response" - }, - "content": { - "$ref": "#/components/schemas/InterleavedContent", - "description": "The content of the model's response" - }, - "stop_reason": { - "type": "string", - "enum": [ - "end_of_turn", - "end_of_message", - "out_of_tokens" - ], - "description": "Reason why the model stopped generating. Options are: - `StopReason.end_of_turn`: The model finished generating the entire response. - `StopReason.end_of_message`: The model finished generating but generated a partial response -- usually, a tool call. The user may call the tool and continue the conversation with the tool's response. - `StopReason.out_of_tokens`: The model ran out of token budget." + "const": "rows", + "default": "rows" }, - "tool_calls": { + "rows": { "type": "array", "items": { - "$ref": "#/components/schemas/ToolCall" - }, - "description": "List of tool calls. Each tool call is a ToolCall object." - } - }, - "additionalProperties": false, - "required": [ - "role", - "content", - "stop_reason" - ], - "title": "CompletionMessage", - "description": "A message containing the model's (assistant) response in a chat conversation." - }, - "ImageContentItem": { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "image", - "default": "image", - "description": "Discriminator type of the content item. Always \"image\"" - }, - "image": { - "type": "object", - "properties": { - "url": { - "$ref": "#/components/schemas/URL", - "description": "A URL of the image or data URL in the format of data:image/{type};base64,{data}. Note that URL could have length limits." - }, - "data": { - "type": "string", - "contentEncoding": "base64", - "description": "base64 encoded image data as string" + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] } }, - "additionalProperties": false, - "description": "Image as a base64 encoded string or an URL" + "description": "The dataset is stored in rows. E.g. - [ {\"messages\": [{\"role\": \"user\", \"content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello, world!\"}]} ]" } }, "additionalProperties": false, "required": [ "type", - "image" + "rows" ], - "title": "ImageContentItem", - "description": "A image content item" + "title": "RowsDataSource", + "description": "A dataset stored in rows." }, - "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": { + "URIDataSource": { + "type": "object", + "properties": { + "type": { "type": "string", - "format": "date-time", - "description": "The time the step completed." + "const": "uri", + "default": "uri" }, - "step_type": { + "uri": { "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." + "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": [ - "turn_id", - "step_id", - "step_type", - "model_response" + "type", + "uri" ], - "title": "InferenceStep", - "description": "An inference step in an agent turn." + "title": "URIDataSource", + "description": "A dataset that can be obtained from a URI." }, - "InterleavedContent": { - "oneOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/InterleavedContentItem" - }, - { + "ListDatasetsResponse": { + "type": "object", + "properties": { + "data": { "type": "array", "items": { - "$ref": "#/components/schemas/InterleavedContentItem" - } + "$ref": "#/components/schemas/Dataset" + }, + "description": "List of datasets" } - ] + }, + "additionalProperties": false, + "required": [ + "data" + ], + "title": "ListDatasetsResponse", + "description": "Response from listing datasets." }, - "InterleavedContentItem": { + "DataSource": { "oneOf": [ { - "$ref": "#/components/schemas/ImageContentItem" + "$ref": "#/components/schemas/URIDataSource" }, { - "$ref": "#/components/schemas/TextContentItem" + "$ref": "#/components/schemas/RowsDataSource" } ], "discriminator": { "propertyName": "type", "mapping": { - "image": "#/components/schemas/ImageContentItem", - "text": "#/components/schemas/TextContentItem" + "uri": "#/components/schemas/URIDataSource", + "rows": "#/components/schemas/RowsDataSource" } } }, - "MemoryRetrievalStep": { + "RegisterDatasetRequest": { "type": "object", "properties": { - "turn_id": { + "purpose": { "type": "string", - "description": "The ID of the turn." + "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\" }" }, - "step_id": { - "type": "string", - "description": "The ID of the step." + "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!\"}, ] } ] }" }, - "started_at": { + "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", - "format": "date-time", - "description": "The time the step started." + "description": "The ID of the dataset. If not provided, an ID will be generated." + } + }, + "additionalProperties": false, + "required": [ + "purpose", + "source" + ], + "title": "RegisterDatasetRequest" + }, + "AgentConfig": { + "type": "object", + "properties": { + "sampling_params": { + "$ref": "#/components/schemas/SamplingParams" }, - "completed_at": { + "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", - "format": "date-time", - "description": "The time the step completed." + "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 }, - "step_type": { + "tool_prompt_format": { "type": "string", "enum": [ - "inference", - "tool_execution", - "shield_call", - "memory_retrieval" + "json", + "function_tag", + "python_list" + ], + "title": "ToolPromptFormat", + "description": "Prompt format for calling custom / zero shot tools.", + "deprecated": true + }, + "tool_config": { + "$ref": "#/components/schemas/ToolConfig" + }, + "max_infer_iters": { + "type": "integer", + "default": 10 + }, + "model": { + "type": "string", + "description": "The model identifier to use for the agent" + }, + "instructions": { + "type": "string", + "description": "The system instructions for the agent" + }, + "name": { + "type": "string", + "description": "Optional name for the agent, used in telemetry and identification" + }, + "enable_session_persistence": { + "type": "boolean", + "default": false, + "description": "Optional flag indicating whether session data has to be persisted" + }, + "response_format": { + "$ref": "#/components/schemas/ResponseFormat", + "description": "Optional response format configuration" + } + }, + "additionalProperties": false, + "required": [ + "model", + "instructions" + ], + "title": "AgentConfig", + "description": "Configuration for an agent." + }, + "AgentTool": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "args": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + } + } + }, + "additionalProperties": false, + "required": [ + "name", + "args" ], - "title": "StepType", - "description": "Type of the step in an agent turn.", - "const": "memory_retrieval", - "default": "memory_retrieval" - }, - "vector_db_ids": { - "type": "string", - "description": "The IDs of the vector databases to retrieve context from." - }, - "inserted_context": { - "$ref": "#/components/schemas/InterleavedContent", - "description": "The context retrieved from the vector databases." + "title": "AgentToolGroupWithArgs" } - }, - "additionalProperties": false, - "required": [ - "turn_id", - "step_id", - "step_type", - "vector_db_ids", - "inserted_context" - ], - "title": "MemoryRetrievalStep", - "description": "A memory retrieval step in an agent turn." + ] }, - "SafetyViolation": { + "GrammarResponseFormat": { "type": "object", "properties": { - "violation_level": { - "$ref": "#/components/schemas/ViolationLevel", - "description": "Severity level of the violation" - }, - "user_message": { + "type": { "type": "string", - "description": "(Optional) Message to convey to the user about the violation" + "enum": [ + "json_schema", + "grammar" + ], + "description": "Must be \"grammar\" to identify this format type", + "const": "grammar", + "default": "grammar" }, - "metadata": { + "bnf": { "type": "object", "additionalProperties": { "oneOf": [ @@ -3258,246 +2256,210 @@ } ] }, - "description": "Additional metadata including specific violation codes for debugging and telemetry" + "description": "The BNF grammar specification the response should conform to" } }, "additionalProperties": false, "required": [ - "violation_level", - "metadata" + "type", + "bnf" ], - "title": "SafetyViolation", - "description": "Details of a safety violation detected by content moderation." + "title": "GrammarResponseFormat", + "description": "Configuration for grammar-guided response generation." }, - "Session": { + "GreedySamplingStrategy": { "type": "object", "properties": { - "session_id": { - "type": "string", - "description": "Unique identifier for the conversation session" - }, - "session_name": { - "type": "string", - "description": "Human-readable name for the session" - }, - "turns": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Turn" - }, - "description": "List of all turns that have occurred in this session" - }, - "started_at": { + "type": { "type": "string", - "format": "date-time", - "description": "Timestamp when the session was created" + "const": "greedy", + "default": "greedy", + "description": "Must be \"greedy\" to identify this sampling strategy" } }, "additionalProperties": false, "required": [ - "session_id", - "session_name", - "turns", - "started_at" + "type" ], - "title": "Session", - "description": "A single session of an interaction with an Agentic System." + "title": "GreedySamplingStrategy", + "description": "Greedy sampling strategy that selects the highest probability token at each step." }, - "ShieldCallStep": { + "JsonSchemaResponseFormat": { "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": { "type": "string", "enum": [ - "inference", - "tool_execution", - "shield_call", - "memory_retrieval" + "json_schema", + "grammar" ], - "title": "StepType", - "description": "Type of the step in an agent turn.", - "const": "shield_call", - "default": "shield_call" + "description": "Must be \"json_schema\" to identify this format type", + "const": "json_schema", + "default": "json_schema" }, - "violation": { - "$ref": "#/components/schemas/SafetyViolation", - "description": "The violation from the shield call." + "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": [ - "turn_id", - "step_id", - "step_type" + "type", + "json_schema" ], - "title": "ShieldCallStep", - "description": "A shield call step in an agent turn." + "title": "JsonSchemaResponseFormat", + "description": "Configuration for JSON schema-guided response generation." }, - "TextContentItem": { - "type": "object", - "properties": { - "type": { - "type": "string", - "const": "text", - "default": "text", - "description": "Discriminator type of the content item. Always \"text\"" + "ResponseFormat": { + "oneOf": [ + { + "$ref": "#/components/schemas/JsonSchemaResponseFormat" }, - "text": { - "type": "string", - "description": "Text content" + { + "$ref": "#/components/schemas/GrammarResponseFormat" } - }, - "additionalProperties": false, - "required": [ - "type", - "text" ], - "title": "TextContentItem", - "description": "A text content item" + "discriminator": { + "propertyName": "type", + "mapping": { + "json_schema": "#/components/schemas/JsonSchemaResponseFormat", + "grammar": "#/components/schemas/GrammarResponseFormat" + } + } }, - "ToolCall": { + "SamplingParams": { "type": "object", "properties": { - "call_id": { - "type": "string" - }, - "tool_name": { + "strategy": { "oneOf": [ { - "type": "string", - "enum": [ - "brave_search", - "wolfram_alpha", - "photogen", - "code_interpreter" - ], - "title": "BuiltinTool" + "$ref": "#/components/schemas/GreedySamplingStrategy" }, { - "type": "string" - } - ] - }, - "arguments": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "call_id", - "tool_name", - "arguments" - ], - "title": "ToolCall" - }, - "ToolExecutionStep": { - "type": "object", - "properties": { - "turn_id": { - "type": "string", - "description": "The ID of the turn." - }, - "step_id": { - "type": "string", - "description": "The ID of the step." - }, - "started_at": { - "type": "string", - "format": "date-time", - "description": "The time the step started." - }, - "completed_at": { - "type": "string", - "format": "date-time", - "description": "The time the step completed." - }, - "step_type": { - "type": "string", - "enum": [ - "inference", - "tool_execution", - "shield_call", - "memory_retrieval" + "$ref": "#/components/schemas/TopPSamplingStrategy" + }, + { + "$ref": "#/components/schemas/TopKSamplingStrategy" + } ], - "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" + "discriminator": { + "propertyName": "type", + "mapping": { + "greedy": "#/components/schemas/GreedySamplingStrategy", + "top_p": "#/components/schemas/TopPSamplingStrategy", + "top_k": "#/components/schemas/TopKSamplingStrategy" + } }, - "description": "The tool calls to execute." + "description": "The sampling strategy." }, - "tool_responses": { + "max_tokens": { + "type": "integer", + "default": 0, + "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": { - "$ref": "#/components/schemas/ToolResponse" + "type": "string" }, - "description": "The tool responses from the tool calls." + "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": [ - "turn_id", - "step_id", - "step_type", - "tool_calls", - "tool_responses" + "strategy" ], - "title": "ToolExecutionStep", - "description": "A tool execution step in an agent turn." + "title": "SamplingParams", + "description": "Sampling parameters." }, - "ToolResponse": { + "ToolConfig": { "type": "object", "properties": { - "call_id": { - "type": "string", - "description": "Unique identifier for the tool call this response is for" - }, - "tool_name": { + "tool_choice": { "oneOf": [ { "type": "string", "enum": [ - "brave_search", - "wolfram_alpha", - "photogen", - "code_interpreter" + "auto", + "required", + "none" ], - "title": "BuiltinTool" + "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" } ], - "description": "Name of the tool that was invoked" + "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." }, - "content": { - "$ref": "#/components/schemas/InterleavedContent", - "description": "The response content from the tool" + "tool_prompt_format": { + "type": "string", + "enum": [ + "json", + "function_tag", + "python_list" + ], + "description": "(Optional) Instructs the model how to format tool calls. By default, Llama Stack will attempt to use a format that is best adapted to the model. - `ToolPromptFormat.json`: The tool calls are formatted as a JSON object. - `ToolPromptFormat.function_tag`: The tool calls are enclosed in a tag. - `ToolPromptFormat.python_list`: The tool calls are output as Python syntax -- a list of function calls." }, - "metadata": { + "system_message_behavior": { + "type": "string", + "enum": [ + "append", + "replace" + ], + "description": "(Optional) Config for how to override the default system prompt. - `SystemMessageBehavior.append`: Appends the provided system message to the default system prompt. - `SystemMessageBehavior.replace`: Replaces the default system prompt with the provided system message. The system message can include the string '{{function_definitions}}' to indicate where the function definitions should be inserted.", + "default": "append" + } + }, + "additionalProperties": false, + "title": "ToolConfig", + "description": "Configuration for tool use." + }, + "ToolDef": { + "type": "object", + "properties": { + "toolgroup_id": { + "type": "string", + "description": "(Optional) ID of the tool group this tool belongs to" + }, + "name": { + "type": "string", + "description": "Name of the tool" + }, + "description": { + "type": "string", + "description": "(Optional) Human-readable description of what the tool does" + }, + "input_schema": { "type": "object", "additionalProperties": { "oneOf": [ @@ -3521,425 +2483,293 @@ } ] }, - "description": "(Optional) Additional metadata about the tool response" - } - }, - "additionalProperties": false, - "required": [ - "call_id", - "tool_name", - "content" - ], - "title": "ToolResponse", - "description": "Response from a tool invocation." - }, - "ToolResponseMessage": { - "type": "object", - "properties": { - "role": { - "type": "string", - "const": "tool", - "default": "tool", - "description": "Must be \"tool\" to identify this as a tool response" - }, - "call_id": { - "type": "string", - "description": "Unique identifier for the tool call this response is for" - }, - "content": { - "$ref": "#/components/schemas/InterleavedContent", - "description": "The response content from the tool" - } - }, - "additionalProperties": false, - "required": [ - "role", - "call_id", - "content" - ], - "title": "ToolResponseMessage", - "description": "A message representing the result of a tool invocation." - }, - "Turn": { - "type": "object", - "properties": { - "turn_id": { - "type": "string", - "description": "Unique identifier for the turn within a session" - }, - "session_id": { - "type": "string", - "description": "Unique identifier for the conversation session" + "description": "(Optional) JSON Schema for tool inputs (MCP inputSchema)" }, - "input_messages": { - "type": "array", - "items": { + "output_schema": { + "type": "object", + "additionalProperties": { "oneOf": [ { - "$ref": "#/components/schemas/UserMessage" + "type": "null" }, { - "$ref": "#/components/schemas/ToolResponseMessage" + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" } ] }, - "description": "List of messages that initiated this turn" + "description": "(Optional) JSON Schema for tool outputs (MCP outputSchema)" }, - "steps": { - "type": "array", - "items": { + "metadata": { + "type": "object", + "additionalProperties": { "oneOf": [ { - "$ref": "#/components/schemas/InferenceStep" + "type": "null" }, { - "$ref": "#/components/schemas/ToolExecutionStep" + "type": "boolean" }, { - "$ref": "#/components/schemas/ShieldCallStep" + "type": "number" }, { - "$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": { - "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." + "type": "string" }, - "mime_type": { - "type": "string", - "description": "The MIME type of the attachment." + { + "type": "array" + }, + { + "type": "object" } - }, - "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": { + "description": "(Optional) Additional metadata about the tool" + } + }, + "additionalProperties": false, + "required": [ + "name" + ], + "title": "ToolDef", + "description": "Tool definition used in runtime contexts." + }, + "TopKSamplingStrategy": { + "type": "object", + "properties": { + "type": { "type": "string", - "format": "date-time", - "description": "Timestamp when the turn began" + "const": "top_k", + "default": "top_k", + "description": "Must be \"top_k\" to identify this sampling strategy" }, - "completed_at": { + "top_k": { + "type": "integer", + "description": "Number of top tokens to consider for sampling. Must be at least 1" + } + }, + "additionalProperties": false, + "required": [ + "type", + "top_k" + ], + "title": "TopKSamplingStrategy", + "description": "Top-k sampling strategy that restricts sampling to the k most likely tokens." + }, + "TopPSamplingStrategy": { + "type": "object", + "properties": { + "type": { "type": "string", - "format": "date-time", - "description": "(Optional) Timestamp when the turn finished, if completed" + "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": [ - "turn_id", - "session_id", - "input_messages", - "steps", - "output_message", - "started_at" + "type" ], - "title": "Turn", - "description": "A single turn in an interaction with an Agentic System." + "title": "TopPSamplingStrategy", + "description": "Top-p (nucleus) sampling strategy that samples from the smallest set of tokens with cumulative probability >= p." }, - "URL": { + "CreateAgentRequest": { "type": "object", "properties": { - "uri": { + "agent_config": { + "$ref": "#/components/schemas/AgentConfig", + "description": "The configuration for the agent." + } + }, + "additionalProperties": false, + "required": [ + "agent_config" + ], + "title": "CreateAgentRequest" + }, + "AgentCreateResponse": { + "type": "object", + "properties": { + "agent_id": { "type": "string", - "description": "The URL string pointing to the resource" + "description": "Unique identifier for the created agent" } }, "additionalProperties": false, "required": [ - "uri" + "agent_id" ], - "title": "URL", - "description": "A URL reference to external content." + "title": "AgentCreateResponse", + "description": "Response returned when creating a new agent." }, - "UserMessage": { + "Agent": { "type": "object", "properties": { - "role": { + "agent_id": { "type": "string", - "const": "user", - "default": "user", - "description": "Must be \"user\" to identify this as a user message" + "description": "Unique identifier for the agent" }, - "content": { - "$ref": "#/components/schemas/InterleavedContent", - "description": "The content of the message, which can include text and other media" + "agent_config": { + "$ref": "#/components/schemas/AgentConfig", + "description": "Configuration settings for the agent" }, - "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." + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp when the agent was created" } }, "additionalProperties": false, "required": [ - "role", - "content" + "agent_id", + "agent_config", + "created_at" ], - "title": "UserMessage", - "description": "A message from the user in a chat conversation." + "title": "Agent", + "description": "An agent instance with configuration and metadata." }, - "ViolationLevel": { - "type": "string", - "enum": [ - "info", - "warn", - "error" + "CreateAgentSessionRequest": { + "type": "object", + "properties": { + "session_name": { + "type": "string", + "description": "The name of the session to create." + } + }, + "additionalProperties": false, + "required": [ + "session_name" ], - "title": "ViolationLevel", - "description": "Severity level of a safety violation." + "title": "CreateAgentSessionRequest" }, - "CreateAgentTurnRequest": { + "AgentSessionCreateResponse": { "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." + "session_id": { + "type": "string", + "description": "Unique identifier for the created session" } }, "additionalProperties": false, "required": [ - "messages" + "session_id" ], - "title": "CreateAgentTurnRequest" + "title": "AgentSessionCreateResponse", + "description": "Response returned when creating a new agent session." }, - "AgentTurnResponseEvent": { + "CompletionMessage": { "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" - } + "role": { + "type": "string", + "const": "assistant", + "default": "assistant", + "description": "Must be \"assistant\" to identify this as the model's response" + }, + "content": { + "$ref": "#/components/schemas/InterleavedContent", + "description": "The content of the model's response" + }, + "stop_reason": { + "type": "string", + "enum": [ + "end_of_turn", + "end_of_message", + "out_of_tokens" ], - "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": "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": "Event-specific payload containing event data" + "description": "List of tool calls. Each tool call is a ToolCall object." } }, "additionalProperties": false, "required": [ - "payload" + "role", + "content", + "stop_reason" ], - "title": "AgentTurnResponseEvent", - "description": "An event in an agent turn response stream." + "title": "CompletionMessage", + "description": "A message containing the model's (assistant) response in a chat conversation." }, - "AgentTurnResponseStepCompletePayload": { + "ImageContentItem": { "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": { "type": "string", - "description": "Unique identifier for the step within a turn" + "const": "image", + "default": "image", + "description": "Discriminator type of the content item. Always \"image\"" }, - "step_details": { - "oneOf": [ - { - "$ref": "#/components/schemas/InferenceStep" - }, - { - "$ref": "#/components/schemas/ToolExecutionStep" - }, - { - "$ref": "#/components/schemas/ShieldCallStep" + "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." }, - { - "$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" + "data": { + "type": "string", + "contentEncoding": "base64", + "description": "base64 encoded image data as string" } }, - "description": "Complete details of the executed step" + "additionalProperties": false, + "description": "Image as a base64 encoded string or an URL" } }, "additionalProperties": false, "required": [ - "event_type", - "step_type", - "step_id", - "step_details" + "type", + "image" ], - "title": "AgentTurnResponseStepCompletePayload", - "description": "Payload for step completion events in agent turn responses." + "title": "ImageContentItem", + "description": "A image content item" }, - "AgentTurnResponseStepProgressPayload": { + "InferenceStep": { "type": "object", "properties": { - "event_type": { + "turn_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" + "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", @@ -3949,61 +2779,79 @@ "shield_call", "memory_retrieval" ], - "description": "Type of step being executed" - }, - "step_id": { - "type": "string", - "description": "Unique identifier for the step within a turn" + "title": "StepType", + "description": "Type of the step in an agent turn.", + "const": "inference", + "default": "inference" }, - "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" + "model_response": { + "$ref": "#/components/schemas/CompletionMessage", + "description": "The response from the LLM." } }, "additionalProperties": false, "required": [ - "event_type", - "step_type", + "turn_id", "step_id", - "delta" + "step_type", + "model_response" ], - "title": "AgentTurnResponseStepProgressPayload", - "description": "Payload for step progress events in agent turn responses." + "title": "InferenceStep", + "description": "An inference step in an agent turn." }, - "AgentTurnResponseStepStartPayload": { + "InterleavedContent": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/InterleavedContentItem" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/InterleavedContentItem" + } + } + ] + }, + "InterleavedContentItem": { + "oneOf": [ + { + "$ref": "#/components/schemas/ImageContentItem" + }, + { + "$ref": "#/components/schemas/TextContentItem" + } + ], + "discriminator": { + "propertyName": "type", + "mapping": { + "image": "#/components/schemas/ImageContentItem", + "text": "#/components/schemas/TextContentItem" + } + } + }, + "MemoryRetrievalStep": { "type": "object", "properties": { - "event_type": { + "turn_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" + "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", @@ -4013,11 +2861,41 @@ "shield_call", "memory_retrieval" ], - "description": "Type of step being executed" + "title": "StepType", + "description": "Type of the step in an agent turn.", + "const": "memory_retrieval", + "default": "memory_retrieval" + }, + "vector_db_ids": { + "type": "string", + "description": "The IDs of the vector databases to retrieve context from." + }, + "inserted_context": { + "$ref": "#/components/schemas/InterleavedContent", + "description": "The context retrieved from the vector databases." + } + }, + "additionalProperties": false, + "required": [ + "turn_id", + "step_id", + "step_type", + "vector_db_ids", + "inserted_context" + ], + "title": "MemoryRetrievalStep", + "description": "A memory retrieval step in an agent turn." + }, + "SafetyViolation": { + "type": "object", + "properties": { + "violation_level": { + "$ref": "#/components/schemas/ViolationLevel", + "description": "Severity level of the violation" }, - "step_id": { + "user_message": { "type": "string", - "description": "Unique identifier for the step within a turn" + "description": "(Optional) Message to convey to the user about the violation" }, "metadata": { "type": "object", @@ -4043,386 +2921,766 @@ } ] }, - "description": "(Optional) Additional metadata for the step" + "description": "Additional metadata including specific violation codes for debugging and telemetry" } }, "additionalProperties": false, "required": [ - "event_type", - "step_type", - "step_id" + "violation_level", + "metadata" ], - "title": "AgentTurnResponseStepStartPayload", - "description": "Payload for step start events in agent turn responses." + "title": "SafetyViolation", + "description": "Details of a safety violation detected by content moderation." }, - "AgentTurnResponseStreamChunk": { + "Session": { "type": "object", "properties": { - "event": { - "$ref": "#/components/schemas/AgentTurnResponseEvent", - "description": "Individual event in the agent turn response stream" + "session_id": { + "type": "string", + "description": "Unique identifier for the conversation session" + }, + "session_name": { + "type": "string", + "description": "Human-readable name for the session" + }, + "turns": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Turn" + }, + "description": "List of all turns that have occurred in this session" + }, + "started_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp when the session was created" } }, "additionalProperties": false, "required": [ - "event" + "session_id", + "session_name", + "turns", + "started_at" ], - "title": "AgentTurnResponseStreamChunk", - "description": "Streamed agent turn completion response." + "title": "Session", + "description": "A single session of an interaction with an Agentic System." }, - "AgentTurnResponseTurnAwaitingInputPayload": { + "ShieldCallStep": { "type": "object", "properties": { - "event_type": { + "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": [ - "step_start", - "step_complete", - "step_progress", - "turn_start", - "turn_complete", - "turn_awaiting_input" + "inference", + "tool_execution", + "shield_call", + "memory_retrieval" ], - "const": "turn_awaiting_input", - "default": "turn_awaiting_input", - "description": "Type of event being reported" + "title": "StepType", + "description": "Type of the step in an agent turn.", + "const": "shield_call", + "default": "shield_call" }, - "turn": { - "$ref": "#/components/schemas/Turn", - "description": "Turn data when waiting for external tool responses" + "violation": { + "$ref": "#/components/schemas/SafetyViolation", + "description": "The violation from the shield call." } }, "additionalProperties": false, "required": [ - "event_type", - "turn" + "turn_id", + "step_id", + "step_type" ], - "title": "AgentTurnResponseTurnAwaitingInputPayload", - "description": "Payload for turn awaiting input events in agent turn responses." + "title": "ShieldCallStep", + "description": "A shield call step in an agent turn." }, - "AgentTurnResponseTurnCompletePayload": { + "TextContentItem": { "type": "object", "properties": { - "event_type": { + "type": { + "type": "string", + "const": "text", + "default": "text", + "description": "Discriminator type of the content item. Always \"text\"" + }, + "text": { + "type": "string", + "description": "Text content" + } + }, + "additionalProperties": false, + "required": [ + "type", + "text" + ], + "title": "TextContentItem", + "description": "A text content item" + }, + "ToolCall": { + "type": "object", + "properties": { + "call_id": { + "type": "string" + }, + "tool_name": { + "oneOf": [ + { + "type": "string", + "enum": [ + "brave_search", + "wolfram_alpha", + "photogen", + "code_interpreter" + ], + "title": "BuiltinTool" + }, + { + "type": "string" + } + ] + }, + "arguments": { + "type": "string" + } + }, + "additionalProperties": false, + "required": [ + "call_id", + "tool_name", + "arguments" + ], + "title": "ToolCall" + }, + "ToolExecutionStep": { + "type": "object", + "properties": { + "turn_id": { + "type": "string", + "description": "The ID of the turn." + }, + "step_id": { + "type": "string", + "description": "The ID of the step." + }, + "started_at": { + "type": "string", + "format": "date-time", + "description": "The time the step started." + }, + "completed_at": { + "type": "string", + "format": "date-time", + "description": "The time the step completed." + }, + "step_type": { "type": "string", "enum": [ - "step_start", - "step_complete", - "step_progress", - "turn_start", - "turn_complete", - "turn_awaiting_input" + "inference", + "tool_execution", + "shield_call", + "memory_retrieval" + ], + "title": "StepType", + "description": "Type of the step in an agent turn.", + "const": "tool_execution", + "default": "tool_execution" + }, + "tool_calls": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ToolCall" + }, + "description": "The tool calls to execute." + }, + "tool_responses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ToolResponse" + }, + "description": "The tool responses from the tool calls." + } + }, + "additionalProperties": false, + "required": [ + "turn_id", + "step_id", + "step_type", + "tool_calls", + "tool_responses" + ], + "title": "ToolExecutionStep", + "description": "A tool execution step in an agent turn." + }, + "ToolResponse": { + "type": "object", + "properties": { + "call_id": { + "type": "string", + "description": "Unique identifier for the tool call this response is for" + }, + "tool_name": { + "oneOf": [ + { + "type": "string", + "enum": [ + "brave_search", + "wolfram_alpha", + "photogen", + "code_interpreter" + ], + "title": "BuiltinTool" + }, + { + "type": "string" + } ], - "const": "turn_complete", - "default": "turn_complete", - "description": "Type of event being reported" + "description": "Name of the tool that was invoked" }, - "turn": { - "$ref": "#/components/schemas/Turn", - "description": "Complete turn data including all steps and results" + "content": { + "$ref": "#/components/schemas/InterleavedContent", + "description": "The response content from the tool" + }, + "metadata": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + }, + "description": "(Optional) Additional metadata about the tool response" } }, "additionalProperties": false, "required": [ - "event_type", - "turn" + "call_id", + "tool_name", + "content" ], - "title": "AgentTurnResponseTurnCompletePayload", - "description": "Payload for turn completion events in agent turn responses." + "title": "ToolResponse", + "description": "Response from a tool invocation." }, - "AgentTurnResponseTurnStartPayload": { + "ToolResponseMessage": { "type": "object", "properties": { - "event_type": { + "role": { "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" + "const": "tool", + "default": "tool", + "description": "Must be \"tool\" to identify this as a tool response" }, - "turn_id": { + "call_id": { "type": "string", - "description": "Unique identifier for the turn within a session" + "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": [ - "event_type", - "turn_id" + "role", + "call_id", + "content" ], - "title": "AgentTurnResponseTurnStartPayload", - "description": "Payload for turn start events in agent turn responses." + "title": "ToolResponseMessage", + "description": "A message representing the result of a tool invocation." }, - "ImageDelta": { + "Turn": { "type": "object", "properties": { - "type": { + "turn_id": { "type": "string", - "const": "image", - "default": "image", - "description": "Discriminator type of the delta. Always \"image\"" + "description": "Unique identifier for the turn within a session" }, - "image": { + "session_id": { "type": "string", - "contentEncoding": "base64", - "description": "The incremental image data as bytes" + "description": "Unique identifier for the conversation session" + }, + "input_messages": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/UserMessage" + }, + { + "$ref": "#/components/schemas/ToolResponseMessage" + } + ] + }, + "description": "List of messages that initiated this turn" + }, + "steps": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InferenceStep" + }, + { + "$ref": "#/components/schemas/ToolExecutionStep" + }, + { + "$ref": "#/components/schemas/ShieldCallStep" + }, + { + "$ref": "#/components/schemas/MemoryRetrievalStep" + } + ], + "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": { + "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": [ - "type", - "image" + "turn_id", + "session_id", + "input_messages", + "steps", + "output_message", + "started_at" ], - "title": "ImageDelta", - "description": "An image content delta for streaming responses." + "title": "Turn", + "description": "A single turn in an interaction with an Agentic System." }, - "TextDelta": { + "URL": { "type": "object", "properties": { - "type": { - "type": "string", - "const": "text", - "default": "text", - "description": "Discriminator type of the delta. Always \"text\"" - }, - "text": { + "uri": { "type": "string", - "description": "The incremental text content" + "description": "The URL string pointing to the resource" } }, "additionalProperties": false, "required": [ - "type", - "text" + "uri" ], - "title": "TextDelta", - "description": "A text content delta for streaming responses." + "title": "URL", + "description": "A URL reference to external content." }, - "ToolCallDelta": { + "UserMessage": { "type": "object", "properties": { - "type": { + "role": { "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" + "const": "user", + "default": "user", + "description": "Must be \"user\" to identify this as a user message" }, - "parse_status": { - "type": "string", - "enum": [ - "started", - "in_progress", - "failed", - "succeeded" - ], - "description": "Current parsing status of the tool call" + "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": [ - "type", - "tool_call", - "parse_status" + "role", + "content" ], - "title": "ToolCallDelta", - "description": "A tool call content delta for streaming responses." + "title": "UserMessage", + "description": "A message from the user in a chat conversation." }, - "ResumeAgentTurnRequest": { + "ViolationLevel": { + "type": "string", + "enum": [ + "info", + "warn", + "error" + ], + "title": "ViolationLevel", + "description": "Severity level of a safety violation." + }, + "CreateAgentTurnRequest": { "type": "object", "properties": { - "tool_responses": { + "messages": { "type": "array", "items": { - "$ref": "#/components/schemas/ToolResponse" + "oneOf": [ + { + "$ref": "#/components/schemas/UserMessage" + }, + { + "$ref": "#/components/schemas/ToolResponseMessage" + } + ] }, - "description": "The tool call responses to resume the turn with." + "description": "List of messages to start the turn with." }, "stream": { "type": "boolean", - "description": "Whether to stream the response." + "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": [ - "tool_responses" + "messages" ], - "title": "ResumeAgentTurnRequest" + "title": "CreateAgentTurnRequest" }, - "AgentStepResponse": { + "AgentTurnResponseEvent": { "type": "object", "properties": { - "step": { + "payload": { "oneOf": [ { - "$ref": "#/components/schemas/InferenceStep" + "$ref": "#/components/schemas/AgentTurnResponseStepStartPayload" }, { - "$ref": "#/components/schemas/ToolExecutionStep" + "$ref": "#/components/schemas/AgentTurnResponseStepProgressPayload" }, { - "$ref": "#/components/schemas/ShieldCallStep" + "$ref": "#/components/schemas/AgentTurnResponseStepCompletePayload" }, { - "$ref": "#/components/schemas/MemoryRetrievalStep" + "$ref": "#/components/schemas/AgentTurnResponseTurnStartPayload" + }, + { + "$ref": "#/components/schemas/AgentTurnResponseTurnCompletePayload" + }, + { + "$ref": "#/components/schemas/AgentTurnResponseTurnAwaitingInputPayload" } ], "discriminator": { - "propertyName": "step_type", + "propertyName": "event_type", "mapping": { - "inference": "#/components/schemas/InferenceStep", - "tool_execution": "#/components/schemas/ToolExecutionStep", - "shield_call": "#/components/schemas/ShieldCallStep", - "memory_retrieval": "#/components/schemas/MemoryRetrievalStep" + "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": "The complete step data and execution details" + "description": "Event-specific payload containing event data" } }, "additionalProperties": false, "required": [ - "step" + "payload" ], - "title": "AgentStepResponse", - "description": "Response containing details of a specific agent step." + "title": "AgentTurnResponseEvent", + "description": "An event in an agent turn response stream." }, - "Benchmark": { + "AgentTurnResponseStepCompletePayload": { "type": "object", "properties": { - "identifier": { - "type": "string" - }, - "provider_resource_id": { - "type": "string" - }, - "provider_id": { - "type": "string" - }, - "type": { + "event_type": { "type": "string", "enum": [ - "model", - "shield", - "vector_db", - "dataset", - "scoring_function", - "benchmark", - "tool", - "tool_group", - "prompt" + "step_start", + "step_complete", + "step_progress", + "turn_start", + "turn_complete", + "turn_awaiting_input" ], - "const": "benchmark", - "default": "benchmark", - "description": "The resource type, always benchmark" + "const": "step_complete", + "default": "step_complete", + "description": "Type of event being reported" }, - "dataset_id": { + "step_type": { "type": "string", - "description": "Identifier of the dataset to use for the benchmark evaluation" + "enum": [ + "inference", + "tool_execution", + "shield_call", + "memory_retrieval" + ], + "description": "Type of step being executed" }, - "scoring_functions": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of scoring function identifiers to apply during evaluation" + "step_id": { + "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": "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" - } + "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": [ - "data" + "event_type", + "step_type", + "step_id", + "step_details" ], - "title": "ListBenchmarksResponse" + "title": "AgentTurnResponseStepCompletePayload", + "description": "Payload for step completion events in agent turn responses." }, - "RegisterBenchmarkRequest": { + "AgentTurnResponseStepProgressPayload": { "type": "object", "properties": { - "benchmark_id": { + "event_type": { "type": "string", - "description": "The ID of the benchmark to register." + "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" }, - "dataset_id": { + "step_type": { "type": "string", - "description": "The ID of the dataset to use for the benchmark." + "enum": [ + "inference", + "tool_execution", + "shield_call", + "memory_retrieval" + ], + "description": "Type of step being executed" }, - "scoring_functions": { - "type": "array", - "items": { - "type": "string" + "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": "The scoring functions to use for the benchmark." + "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" }, - "provider_benchmark_id": { + "step_type": { "type": "string", - "description": "The ID of the provider benchmark to use for the benchmark." + "enum": [ + "inference", + "tool_execution", + "shield_call", + "memory_retrieval" + ], + "description": "Type of step being executed" }, - "provider_id": { + "step_id": { "type": "string", - "description": "The ID of the provider to use for the benchmark." + "description": "Unique identifier for the step within a turn" }, "metadata": { "type": "object", @@ -4448,407 +3706,307 @@ } ] }, - "description": "The metadata to use for the benchmark." + "description": "(Optional) Additional metadata for the step" } }, "additionalProperties": false, "required": [ - "benchmark_id", - "dataset_id", - "scoring_functions" + "event_type", + "step_type", + "step_id" ], - "title": "RegisterBenchmarkRequest" + "title": "AgentTurnResponseStepStartPayload", + "description": "Payload for step start events in agent turn responses." }, - "AgentCandidate": { + "AgentTurnResponseStreamChunk": { "type": "object", "properties": { - "type": { - "type": "string", - "const": "agent", - "default": "agent" - }, - "config": { - "$ref": "#/components/schemas/AgentConfig", - "description": "The configuration for the agent candidate." + "event": { + "$ref": "#/components/schemas/AgentTurnResponseEvent", + "description": "Individual event in the agent turn response stream" } }, "additionalProperties": false, "required": [ - "type", - "config" - ], - "title": "AgentCandidate", - "description": "An agent candidate for evaluation." - }, - "AggregationFunctionType": { - "type": "string", - "enum": [ - "average", - "weighted_average", - "median", - "categorical_count", - "accuracy" + "event" ], - "title": "AggregationFunctionType", - "description": "Types of aggregation functions for scoring results." + "title": "AgentTurnResponseStreamChunk", + "description": "Streamed agent turn completion response." }, - "BasicScoringFnParams": { + "AgentTurnResponseTurnAwaitingInputPayload": { "type": "object", "properties": { - "type": { - "$ref": "#/components/schemas/ScoringFnParamsType", - "const": "basic", - "default": "basic", - "description": "The type of scoring function parameters, always basic" + "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" }, - "aggregation_functions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AggregationFunctionType" - }, - "description": "Aggregation functions to apply to the scores of each row" + "turn": { + "$ref": "#/components/schemas/Turn", + "description": "Turn data when waiting for external tool responses" } }, "additionalProperties": false, "required": [ - "type", - "aggregation_functions" + "event_type", + "turn" ], - "title": "BasicScoringFnParams", - "description": "Parameters for basic scoring function configuration." + "title": "AgentTurnResponseTurnAwaitingInputPayload", + "description": "Payload for turn awaiting input events in agent turn responses." }, - "BenchmarkConfig": { + "AgentTurnResponseTurnCompletePayload": { "type": "object", "properties": { - "eval_candidate": { - "oneOf": [ - { - "$ref": "#/components/schemas/ModelCandidate" - }, - { - "$ref": "#/components/schemas/AgentCandidate" - } + "event_type": { + "type": "string", + "enum": [ + "step_start", + "step_complete", + "step_progress", + "turn_start", + "turn_complete", + "turn_awaiting_input" ], - "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" + "const": "turn_complete", + "default": "turn_complete", + "description": "Type of event being reported" }, - "num_examples": { - "type": "integer", - "description": "(Optional) The number of examples to evaluate. If not provided, all examples in the dataset will be evaluated" + "turn": { + "$ref": "#/components/schemas/Turn", + "description": "Complete turn data including all steps and results" } }, "additionalProperties": false, "required": [ - "eval_candidate", - "scoring_params" + "event_type", + "turn" ], - "title": "BenchmarkConfig", - "description": "A benchmark configuration for evaluation." + "title": "AgentTurnResponseTurnCompletePayload", + "description": "Payload for turn completion events in agent turn responses." }, - "LLMAsJudgeScoringFnParams": { + "AgentTurnResponseTurnStartPayload": { "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": { + "event_type": { "type": "string", - "description": "Identifier of the LLM model to use as a judge for scoring" + "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" }, - "prompt_template": { + "turn_id": { "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" + "description": "Unique identifier for the turn within a session" } }, "additionalProperties": false, "required": [ - "type", - "judge_model", - "judge_score_regexes", - "aggregation_functions" + "event_type", + "turn_id" ], - "title": "LLMAsJudgeScoringFnParams", - "description": "Parameters for LLM-as-judge scoring function configuration." + "title": "AgentTurnResponseTurnStartPayload", + "description": "Payload for turn start events in agent turn responses." }, - "ModelCandidate": { + "ImageDelta": { "type": "object", "properties": { "type": { "type": "string", - "const": "model", - "default": "model" + "const": "image", + "default": "image", + "description": "Discriminator type of the delta. Always \"image\"" }, - "model": { + "image": { "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." + "contentEncoding": "base64", + "description": "The incremental image data as bytes" } }, "additionalProperties": false, "required": [ "type", - "model", - "sampling_params" + "image" ], - "title": "ModelCandidate", - "description": "A model candidate for evaluation." + "title": "ImageDelta", + "description": "An image content delta for streaming responses." }, - "RegexParserScoringFnParams": { + "TextDelta": { "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" + "type": "string", + "const": "text", + "default": "text", + "description": "Discriminator type of the delta. Always \"text\"" }, - "aggregation_functions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/AggregationFunctionType" - }, - "description": "Aggregation functions to apply to the scores of each row" + "text": { + "type": "string", + "description": "The incremental text content" } }, "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" + "text" ], - "title": "ScoringFnParamsType", - "description": "Types of scoring function parameter configurations." + "title": "TextDelta", + "description": "A text content delta for streaming responses." }, - "SystemMessage": { + "ToolCallDelta": { "type": "object", "properties": { - "role": { + "type": { "type": "string", - "const": "system", - "default": "system", - "description": "Must be \"system\" to identify this as a system message" + "const": "tool_call", + "default": "tool_call", + "description": "Discriminator type of the delta. Always \"tool_call\"" }, - "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)." + "tool_call": { + "oneOf": [ + { + "type": "string" + }, + { + "$ref": "#/components/schemas/ToolCall" + } + ], + "description": "Either an in-progress tool call string or the final parsed tool call" + }, + "parse_status": { + "type": "string", + "enum": [ + "started", + "in_progress", + "failed", + "succeeded" + ], + "description": "Current parsing status of the tool call" } }, "additionalProperties": false, "required": [ - "role", - "content" + "type", + "tool_call", + "parse_status" ], - "title": "SystemMessage", - "description": "A system message providing instructions or context to the model." + "title": "ToolCallDelta", + "description": "A tool call content delta for streaming responses." }, - "EvaluateRowsRequest": { + "ResumeAgentTurnRequest": { "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": { + "tool_responses": { "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/ToolResponse" }, - "description": "The scoring functions to use for the evaluation." + "description": "The tool call responses to resume the turn with." }, - "benchmark_config": { - "$ref": "#/components/schemas/BenchmarkConfig", - "description": "The configuration for the benchmark." + "stream": { + "type": "boolean", + "description": "Whether to stream the response." } }, "additionalProperties": false, "required": [ - "input_rows", - "scoring_functions", - "benchmark_config" + "tool_responses" ], - "title": "EvaluateRowsRequest" + "title": "ResumeAgentTurnRequest" }, - "EvaluateResponse": { + "AgentStepResponse": { "type": "object", "properties": { - "generations": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] + "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 generations from the evaluation." - }, - "scores": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/ScoringResult" - }, - "description": "The scores from the evaluation." + "description": "The complete step data and execution details" } }, "additionalProperties": false, "required": [ - "generations", - "scores" + "step" ], - "title": "EvaluateResponse", - "description": "The response from an evaluation." + "title": "AgentStepResponse", + "description": "Response containing details of a specific agent step." }, - "ScoringResult": { + "Benchmark": { "type": "object", "properties": { - "score_rows": { + "identifier": { + "type": "string" + }, + "provider_resource_id": { + "type": "string" + }, + "provider_id": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "model", + "shield", + "vector_db", + "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": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - } + "type": "string" }, - "description": "The scoring result for each row. Each row is a map of column name to value." + "description": "List of scoring function identifiers to apply during evaluation" }, - "aggregated_results": { + "metadata": { "type": "object", "additionalProperties": { "oneOf": [ @@ -4872,351 +4030,488 @@ } ] }, - "description": "Map of metric name to aggregated value" + "description": "Metadata for this evaluation task" } }, "additionalProperties": false, "required": [ - "score_rows", - "aggregated_results" + "identifier", + "provider_id", + "type", + "dataset_id", + "scoring_functions", + "metadata" ], - "title": "ScoringResult", - "description": "A scoring result for a single row." + "title": "Benchmark", + "description": "A benchmark resource for evaluating model performance." }, - "RunEvalRequest": { + "ListBenchmarksResponse": { "type": "object", "properties": { - "benchmark_config": { - "$ref": "#/components/schemas/BenchmarkConfig", - "description": "The configuration for the benchmark." + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Benchmark" + } } }, "additionalProperties": false, "required": [ - "benchmark_config" + "data" ], - "title": "RunEvalRequest" + "title": "ListBenchmarksResponse" }, - "Job": { + "RegisterBenchmarkRequest": { "type": "object", "properties": { - "job_id": { + "benchmark_id": { "type": "string", - "description": "Unique identifier for the job" + "description": "The ID of the benchmark to register." }, - "status": { + "dataset_id": { "type": "string", - "enum": [ - "completed", - "in_progress", - "failed", - "scheduled", - "cancelled" - ], - "description": "Current execution status of the job" + "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": [ - "job_id", - "status" + "benchmark_id", + "dataset_id", + "scoring_functions" ], - "title": "Job", - "description": "A job execution instance with status tracking." + "title": "RegisterBenchmarkRequest" }, - "OpenAIChatCompletionContentPartImageParam": { + "AgentCandidate": { "type": "object", "properties": { "type": { "type": "string", - "const": "image_url", - "default": "image_url", - "description": "Must be \"image_url\" to identify this as image content" + "const": "agent", + "default": "agent" }, - "image_url": { - "$ref": "#/components/schemas/OpenAIImageURL", - "description": "Image URL specification and processing details" + "config": { + "$ref": "#/components/schemas/AgentConfig", + "description": "The configuration for the agent candidate." } }, "additionalProperties": false, "required": [ "type", - "image_url" + "config" ], - "title": "OpenAIChatCompletionContentPartImageParam", - "description": "Image content part for OpenAI-compatible chat completion messages." + "title": "AgentCandidate", + "description": "An agent candidate for evaluation." }, - "OpenAIChatCompletionContentPartTextParam": { + "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": { - "type": "string", - "const": "text", - "default": "text", - "description": "Must be \"text\" to identify this as text content" + "$ref": "#/components/schemas/ScoringFnParamsType", + "const": "basic", + "default": "basic", + "description": "The type of scoring function parameters, always basic" }, - "text": { - "type": "string", - "description": "The text content of the message" + "aggregation_functions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AggregationFunctionType" + }, + "description": "Aggregation functions to apply to the scores of each row" } }, "additionalProperties": false, "required": [ "type", - "text" + "aggregation_functions" ], - "title": "OpenAIChatCompletionContentPartTextParam", - "description": "Text content part for OpenAI-compatible chat completion messages." + "title": "BasicScoringFnParams", + "description": "Parameters for basic scoring function configuration." }, - "OpenAIImageURL": { + "BenchmarkConfig": { "type": "object", "properties": { - "url": { - "type": "string", - "description": "URL of the image to include in the message" + "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." }, - "detail": { - "type": "string", - "description": "(Optional) Level of detail for image processing. Can be \"low\", \"high\", or \"auto\"" + "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": [ - "url" + "eval_candidate", + "scoring_params" ], - "title": "OpenAIImageURL", - "description": "Image URL specification for OpenAI-compatible chat completion messages." + "title": "BenchmarkConfig", + "description": "A benchmark configuration for evaluation." }, - "RerankRequest": { + "LLMAsJudgeScoringFnParams": { "type": "object", "properties": { - "model": { + "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": "The identifier of the reranking model to use." + "description": "Identifier of the LLM model to use as a judge for scoring" }, - "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." + "prompt_template": { + "type": "string", + "description": "(Optional) Custom prompt template for the judge model" }, - "items": { + "judge_score_regexes": { "type": "array", "items": { - "oneOf": [ - { - "type": "string" - }, - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" - } - ] + "type": "string" }, - "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." + "description": "Regexes to extract the answer from generated response" }, - "max_num_results": { - "type": "integer", - "description": "(Optional) Maximum number of results to return. Default: returns all." + "aggregation_functions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AggregationFunctionType" + }, + "description": "Aggregation functions to apply to the scores of each row" } }, "additionalProperties": false, "required": [ - "model", - "query", - "items" + "type", + "judge_model", + "judge_score_regexes", + "aggregation_functions" ], - "title": "RerankRequest" + "title": "LLMAsJudgeScoringFnParams", + "description": "Parameters for LLM-as-judge scoring function configuration." }, - "RerankData": { + "ModelCandidate": { "type": "object", "properties": { - "index": { - "type": "integer", - "description": "The original index of the document in the input list" + "type": { + "type": "string", + "const": "model", + "default": "model" }, - "relevance_score": { - "type": "number", - "description": "The relevance score from the model output. Values are inverted when applicable so that higher scores indicate greater relevance." + "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": [ - "index", - "relevance_score" + "type", + "model", + "sampling_params" ], - "title": "RerankData", - "description": "A single rerank result from a reranking response." + "title": "ModelCandidate", + "description": "A model candidate for evaluation." }, - "RerankResponse": { + "RegexParserScoringFnParams": { "type": "object", "properties": { - "data": { + "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": { - "$ref": "#/components/schemas/RerankData" + "type": "string" }, - "description": "List of rerank result objects, sorted by relevance score (descending)" + "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": [ - "data" + "type", + "parsing_regexes", + "aggregation_functions" ], - "title": "RerankResponse", - "description": "Response from a reranking request." + "title": "RegexParserScoringFnParams", + "description": "Parameters for regex parser scoring function configuration." }, - "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" + "ScoringFnParams": { + "oneOf": [ + { + "$ref": "#/components/schemas/LLMAsJudgeScoringFnParams" }, - "path": { - "type": "string", - "description": "File system path where the checkpoint is stored" + { + "$ref": "#/components/schemas/RegexParserScoringFnParams" }, - "training_metrics": { - "$ref": "#/components/schemas/PostTrainingMetric", - "description": "(Optional) Training metrics associated with this checkpoint" + { + "$ref": "#/components/schemas/BasicScoringFnParams" } - }, - "additionalProperties": false, - "required": [ - "identifier", - "created_at", - "epoch", - "post_training_job_id", - "path" ], - "title": "Checkpoint", - "description": "Checkpoint created during training runs." + "discriminator": { + "propertyName": "type", + "mapping": { + "llm_as_judge": "#/components/schemas/LLMAsJudgeScoringFnParams", + "regex_parser": "#/components/schemas/RegexParserScoringFnParams", + "basic": "#/components/schemas/BasicScoringFnParams" + } + } }, - "PostTrainingJobArtifactsResponse": { + "ScoringFnParamsType": { + "type": "string", + "enum": [ + "llm_as_judge", + "regex_parser", + "basic" + ], + "title": "ScoringFnParamsType", + "description": "Types of scoring function parameter configurations." + }, + "SystemMessage": { "type": "object", "properties": { - "job_uuid": { + "role": { "type": "string", - "description": "Unique identifier for the training job" + "const": "system", + "default": "system", + "description": "Must be \"system\" to identify this as a system message" }, - "checkpoints": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Checkpoint" - }, - "description": "List of model checkpoints created during training" + "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": [ - "job_uuid", - "checkpoints" + "role", + "content" ], - "title": "PostTrainingJobArtifactsResponse", - "description": "Artifacts of a finetuning job." + "title": "SystemMessage", + "description": "A system message providing instructions or context to the model." }, - "PostTrainingMetric": { + "EvaluateRowsRequest": { "type": "object", "properties": { - "epoch": { - "type": "integer", - "description": "Training epoch number" - }, - "train_loss": { - "type": "number", - "description": "Loss value on the training dataset" + "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." }, - "validation_loss": { - "type": "number", - "description": "Loss value on the validation dataset" + "scoring_functions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The scoring functions to use for the evaluation." }, - "perplexity": { - "type": "number", - "description": "Perplexity metric indicating model confidence" + "benchmark_config": { + "$ref": "#/components/schemas/BenchmarkConfig", + "description": "The configuration for the benchmark." } }, "additionalProperties": false, "required": [ - "epoch", - "train_loss", - "validation_loss", - "perplexity" + "input_rows", + "scoring_functions", + "benchmark_config" ], - "title": "PostTrainingMetric", - "description": "Training metrics captured during post-training jobs." + "title": "EvaluateRowsRequest" }, - "CancelTrainingJobRequest": { + "EvaluateResponse": { "type": "object", "properties": { - "job_uuid": { - "type": "string", - "description": "The UUID of the job to cancel." + "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": [ - "job_uuid" + "generations", + "scores" ], - "title": "CancelTrainingJobRequest" + "title": "EvaluateResponse", + "description": "The response from an evaluation." }, - "PostTrainingJobStatusResponse": { + "ScoringResult": { "type": "object", "properties": { - "job_uuid": { - "type": "string", - "description": "Unique identifier for the training job" - }, - "status": { - "type": "string", - "enum": [ - "completed", - "in_progress", - "failed", - "scheduled", - "cancelled" - ], - "description": "Current status of the training job" - }, - "scheduled_at": { - "type": "string", - "format": "date-time", - "description": "(Optional) Timestamp when the job was scheduled" - }, - "started_at": { - "type": "string", - "format": "date-time", - "description": "(Optional) Timestamp when the job execution began" - }, - "completed_at": { - "type": "string", - "format": "date-time", - "description": "(Optional) Timestamp when the job finished, if completed" + "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." }, - "resources_allocated": { + "aggregated_results": { "type": "object", "additionalProperties": { "oneOf": [ @@ -5238,487 +4533,353 @@ { "type": "object" } - ] - }, - "description": "(Optional) Information about computational resources allocated to the job" - }, - "checkpoints": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Checkpoint" - }, - "description": "List of model checkpoints created during training" - } - }, - "additionalProperties": false, - "required": [ - "job_uuid", - "status", - "checkpoints" - ], - "title": "PostTrainingJobStatusResponse", - "description": "Status of a finetuning job." - }, - "ListPostTrainingJobsResponse": { - "type": "object", - "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": { - "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" + ] + }, + "description": "Map of metric name to aggregated value" } }, "additionalProperties": false, "required": [ - "dataset_id", - "batch_size", - "shuffle", - "data_format" + "score_rows", + "aggregated_results" ], - "title": "DataConfig", - "description": "Configuration for training data and data loading." + "title": "ScoringResult", + "description": "A scoring result for a single row." }, - "DatasetFormat": { - "type": "string", - "enum": [ - "instruct", - "dialog" + "RunEvalRequest": { + "type": "object", + "properties": { + "benchmark_config": { + "$ref": "#/components/schemas/BenchmarkConfig", + "description": "The configuration for the benchmark." + } + }, + "additionalProperties": false, + "required": [ + "benchmark_config" ], - "title": "DatasetFormat", - "description": "Format of the training dataset." + "title": "RunEvalRequest" }, - "EfficiencyConfig": { + "Job": { "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" + "job_id": { + "type": "string", + "description": "Unique identifier for the job" }, - "fsdp_cpu_offload": { - "type": "boolean", - "default": false, - "description": "(Optional) Whether to offload FSDP parameters to CPU" + "status": { + "type": "string", + "enum": [ + "completed", + "in_progress", + "failed", + "scheduled", + "cancelled" + ], + "description": "Current execution status of the job" } }, "additionalProperties": false, - "title": "EfficiencyConfig", - "description": "Configuration for memory and compute efficiency optimizations." + "required": [ + "job_id", + "status" + ], + "title": "Job", + "description": "A job execution instance with status tracking." }, - "OptimizerConfig": { + "OpenAIChatCompletionContentPartImageParam": { "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" + "type": { + "type": "string", + "const": "image_url", + "default": "image_url", + "description": "Must be \"image_url\" to identify this as image content" }, - "num_warmup_steps": { - "type": "integer", - "description": "Number of steps for learning rate warmup" + "image_url": { + "$ref": "#/components/schemas/OpenAIImageURL", + "description": "Image URL specification and processing details" } }, "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" + "type", + "image_url" ], - "title": "OptimizerType", - "description": "Available optimizer algorithms for training." + "title": "OpenAIChatCompletionContentPartImageParam", + "description": "Image content part for OpenAI-compatible chat completion messages." }, - "TrainingConfig": { + "OpenAIChatCompletionContentPartTextParam": { "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" + "type": { + "type": "string", + "const": "text", + "default": "text", + "description": "Must be \"text\" to identify this as text content" }, - "dtype": { + "text": { "type": "string", - "default": "bf16", - "description": "(Optional) Data type for model parameters (bf16, fp16, fp32)" + "description": "The text content of the message" } }, "additionalProperties": false, "required": [ - "n_epochs", - "max_steps_per_epoch", - "gradient_accumulation_steps" + "type", + "text" ], - "title": "TrainingConfig", - "description": "Comprehensive configuration for the training process." + "title": "OpenAIChatCompletionContentPartTextParam", + "description": "Text content part for OpenAI-compatible chat completion messages." }, - "PreferenceOptimizeRequest": { + "OpenAIImageURL": { "type": "object", "properties": { - "job_uuid": { + "url": { "type": "string", - "description": "The UUID of the job to create." + "description": "URL of the image to include in the message" }, - "finetuned_model": { + "detail": { "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." + "description": "(Optional) Level of detail for image processing. Can be \"low\", \"high\", or \"auto\"" + } + }, + "additionalProperties": false, + "required": [ + "url" + ], + "title": "OpenAIImageURL", + "description": "Image URL specification for OpenAI-compatible chat completion messages." + }, + "RerankRequest": { + "type": "object", + "properties": { + "model": { + "type": "string", + "description": "The identifier of the reranking model to use." }, - "hyperparam_search_config": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "The hyperparam search configuration." + "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." }, - "logger_config": { - "type": "object", - "additionalProperties": { + "items": { + "type": "array", + "items": { "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, { "type": "string" }, { - "type": "array" + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" }, { - "type": "object" + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" } ] }, - "description": "The logger configuration." + "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": [ - "job_uuid", - "finetuned_model", - "algorithm_config", - "training_config", - "hyperparam_search_config", - "logger_config" + "model", + "query", + "items" ], - "title": "PreferenceOptimizeRequest" + "title": "RerankRequest" }, - "PostTrainingJob": { + "RerankData": { "type": "object", "properties": { - "job_uuid": { - "type": "string" + "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": [ - "job_uuid" + "index", + "relevance_score" ], - "title": "PostTrainingJob" + "title": "RerankData", + "description": "A single rerank result from a reranking response." }, - "AlgorithmConfig": { - "oneOf": [ - { - "$ref": "#/components/schemas/LoraFinetuningConfig" - }, - { - "$ref": "#/components/schemas/QATFinetuningConfig" + "RerankResponse": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RerankData" + }, + "description": "List of rerank result objects, sorted by relevance score (descending)" } + }, + "additionalProperties": false, + "required": [ + "data" ], - "discriminator": { - "propertyName": "type", - "mapping": { - "LoRA": "#/components/schemas/LoraFinetuningConfig", - "QAT": "#/components/schemas/QATFinetuningConfig" + "title": "RerankResponse", + "description": "Response from a reranking request." + }, + "Checkpoint": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "Unique identifier for the checkpoint" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp when the checkpoint was created" + }, + "epoch": { + "type": "integer", + "description": "Training epoch when the checkpoint was saved" + }, + "post_training_job_id": { + "type": "string", + "description": "Identifier of the training job that created this checkpoint" + }, + "path": { + "type": "string", + "description": "File system path where the checkpoint is stored" + }, + "training_metrics": { + "$ref": "#/components/schemas/PostTrainingMetric", + "description": "(Optional) Training metrics associated with this checkpoint" } - } + }, + "additionalProperties": false, + "required": [ + "identifier", + "created_at", + "epoch", + "post_training_job_id", + "path" + ], + "title": "Checkpoint", + "description": "Checkpoint created during training runs." }, - "LoraFinetuningConfig": { + "PostTrainingJobArtifactsResponse": { "type": "object", "properties": { - "type": { + "job_uuid": { "type": "string", - "const": "LoRA", - "default": "LoRA", - "description": "Algorithm type identifier, always \"LoRA\"" + "description": "Unique identifier for the training job" }, - "lora_attn_modules": { + "checkpoints": { "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/Checkpoint" }, - "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": { + "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": "Rank of the LoRA adaptation (lower rank = fewer parameters)" + "description": "Training epoch number" }, - "alpha": { - "type": "integer", - "description": "LoRA scaling parameter that controls adaptation strength" + "train_loss": { + "type": "number", + "description": "Loss value on the training dataset" }, - "use_dora": { - "type": "boolean", - "default": false, - "description": "(Optional) Whether to use DoRA (Weight-Decomposed Low-Rank Adaptation)" + "validation_loss": { + "type": "number", + "description": "Loss value on the validation dataset" }, - "quantize_base": { - "type": "boolean", - "default": false, - "description": "(Optional) Whether to quantize the base model weights" + "perplexity": { + "type": "number", + "description": "Perplexity metric indicating model confidence" } }, "additionalProperties": false, "required": [ - "type", - "lora_attn_modules", - "apply_lora_to_mlp", - "apply_lora_to_output", - "rank", - "alpha" + "epoch", + "train_loss", + "validation_loss", + "perplexity" ], - "title": "LoraFinetuningConfig", - "description": "Configuration for Low-Rank Adaptation (LoRA) fine-tuning." + "title": "PostTrainingMetric", + "description": "Training metrics captured during post-training jobs." }, - "QATFinetuningConfig": { + "CancelTrainingJobRequest": { "type": "object", "properties": { - "type": { - "type": "string", - "const": "QAT", - "default": "QAT", - "description": "Algorithm type identifier, always \"QAT\"" - }, - "quantizer_name": { + "job_uuid": { "type": "string", - "description": "Name of the quantization algorithm to use" - }, - "group_size": { - "type": "integer", - "description": "Size of groups for grouped quantization" + "description": "The UUID of the job to cancel." } }, "additionalProperties": false, "required": [ - "type", - "quantizer_name", - "group_size" + "job_uuid" ], - "title": "QATFinetuningConfig", - "description": "Configuration for Quantization-Aware Training (QAT) fine-tuning." + "title": "CancelTrainingJobRequest" }, - "SupervisedFineTuneRequest": { + "PostTrainingJobStatusResponse": { "type": "object", "properties": { "job_uuid": { "type": "string", - "description": "The UUID of the job to create." + "description": "Unique identifier for the training job" }, - "training_config": { - "$ref": "#/components/schemas/TrainingConfig", - "description": "The training configuration." + "status": { + "type": "string", + "enum": [ + "completed", + "in_progress", + "failed", + "scheduled", + "cancelled" + ], + "description": "Current status of the training job" }, - "hyperparam_search_config": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "The hyperparam search configuration." + "scheduled_at": { + "type": "string", + "format": "date-time", + "description": "(Optional) Timestamp when the job was scheduled" + }, + "started_at": { + "type": "string", + "format": "date-time", + "description": "(Optional) Timestamp when the job execution began" + }, + "completed_at": { + "type": "string", + "format": "date-time", + "description": "(Optional) Timestamp when the job finished, if completed" }, - "logger_config": { + "resources_allocated": { "type": "object", "additionalProperties": { "oneOf": [ @@ -5742,304 +4903,298 @@ } ] }, - "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." + "description": "(Optional) Information about computational resources allocated to the job" }, - "algorithm_config": { - "$ref": "#/components/schemas/AlgorithmConfig", - "description": "The algorithm configuration." + "checkpoints": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Checkpoint" + }, + "description": "List of model checkpoints created during training" } }, "additionalProperties": false, "required": [ "job_uuid", - "training_config", - "hyperparam_search_config", - "logger_config" + "status", + "checkpoints" ], - "title": "SupervisedFineTuneRequest" + "title": "PostTrainingJobStatusResponse", + "description": "Status of a finetuning job." }, - "QueryMetricsRequest": { + "ListPostTrainingJobsResponse": { "type": "object", "properties": { - "start_time": { - "type": "integer", - "description": "The start time of the metric to query." - }, - "end_time": { - "type": "integer", - "description": "The end time of the metric to query." - }, - "granularity": { - "type": "string", - "description": "The granularity of the metric to query." - }, - "query_type": { - "type": "string", - "enum": [ - "range", - "instant" - ], - "description": "The type of query to perform." - }, - "label_matchers": { + "data": { "type": "array", "items": { "type": "object", "properties": { - "name": { - "type": "string", - "description": "The name of the label to match" - }, - "value": { - "type": "string", - "description": "The value to match against" - }, - "operator": { - "type": "string", - "enum": [ - "=", - "!=", - "=~", - "!~" - ], - "description": "The comparison operator to use for matching", - "default": "=" + "job_uuid": { + "type": "string" } }, "additionalProperties": false, "required": [ - "name", - "value", - "operator" + "job_uuid" ], - "title": "MetricLabelMatcher", - "description": "A matcher for filtering metrics by label values." - }, - "description": "The label matchers to apply to the metric." + "title": "PostTrainingJob" + } } }, "additionalProperties": false, "required": [ - "start_time", - "query_type" + "data" ], - "title": "QueryMetricsRequest" + "title": "ListPostTrainingJobsResponse" }, - "MetricDataPoint": { + "DPOAlignmentConfig": { "type": "object", "properties": { - "timestamp": { - "type": "integer", - "description": "Unix timestamp when the metric value was recorded" - }, - "value": { + "beta": { "type": "number", - "description": "The numeric value of the metric at this timestamp" + "description": "Temperature parameter for the DPO loss" }, - "unit": { - "type": "string" + "loss_type": { + "$ref": "#/components/schemas/DPOLossType", + "default": "sigmoid", + "description": "The type of loss function to use for DPO" } }, "additionalProperties": false, "required": [ - "timestamp", - "value", - "unit" + "beta", + "loss_type" ], - "title": "MetricDataPoint", - "description": "A single data point in a metric time series." + "title": "DPOAlignmentConfig", + "description": "Configuration for Direct Preference Optimization (DPO) alignment." }, - "MetricLabel": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the label" - }, - "value": { - "type": "string", - "description": "The value of the label" - } - }, - "additionalProperties": false, - "required": [ - "name", - "value" + "DPOLossType": { + "type": "string", + "enum": [ + "sigmoid", + "hinge", + "ipo", + "kto_pair" ], - "title": "MetricLabel", - "description": "A label associated with a metric." + "title": "DPOLossType" }, - "MetricSeries": { + "DataConfig": { "type": "object", "properties": { - "metric": { + "dataset_id": { "type": "string", - "description": "The name of the metric" + "description": "Unique identifier for the training dataset" }, - "labels": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MetricLabel" - }, - "description": "List of labels associated with this metric series" + "batch_size": { + "type": "integer", + "description": "Number of samples per training batch" }, - "values": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MetricDataPoint" - }, - "description": "List of data points in chronological order" + "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": [ - "metric", - "labels", - "values" + "dataset_id", + "batch_size", + "shuffle", + "data_format" + ], + "title": "DataConfig", + "description": "Configuration for training data and data loading." + }, + "DatasetFormat": { + "type": "string", + "enum": [ + "instruct", + "dialog" ], - "title": "MetricSeries", - "description": "A time series of metric data points." + "title": "DatasetFormat", + "description": "Format of the training dataset." }, - "QueryMetricsResponse": { + "EfficiencyConfig": { "type": "object", "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MetricSeries" - }, - "description": "List of metric series matching the query criteria" + "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, - "required": [ - "data" - ], - "title": "QueryMetricsResponse", - "description": "Response containing metric time series data." + "title": "EfficiencyConfig", + "description": "Configuration for memory and compute efficiency optimizations." }, - "QueryCondition": { + "OptimizerConfig": { "type": "object", "properties": { - "key": { - "type": "string", - "description": "The attribute key to filter on" + "optimizer_type": { + "$ref": "#/components/schemas/OptimizerType", + "description": "Type of optimizer to use (adam, adamw, or sgd)" }, - "op": { - "$ref": "#/components/schemas/QueryConditionOp", - "description": "The comparison operator to apply" + "lr": { + "type": "number", + "description": "Learning rate for the optimizer" }, - "value": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ], - "description": "The value to compare against" + "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": [ - "key", - "op", - "value" + "optimizer_type", + "lr", + "weight_decay", + "num_warmup_steps" ], - "title": "QueryCondition", - "description": "A condition for filtering query results." + "title": "OptimizerConfig", + "description": "Configuration parameters for the optimization algorithm." }, - "QueryConditionOp": { + "OptimizerType": { "type": "string", "enum": [ - "eq", - "ne", - "gt", - "lt" + "adam", + "adamw", + "sgd" ], - "title": "QueryConditionOp", - "description": "Comparison operators for query conditions." + "title": "OptimizerType", + "description": "Available optimizer algorithms for training." }, - "QuerySpansRequest": { + "TrainingConfig": { "type": "object", "properties": { - "attribute_filters": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QueryCondition" - }, - "description": "The attribute filters to apply to the spans." + "n_epochs": { + "type": "integer", + "description": "Number of training epochs to run" }, - "attributes_to_return": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The attributes to return in the spans." + "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_depth": { + "max_validation_steps": { "type": "integer", - "description": "The maximum depth of the tree." + "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": [ - "attribute_filters", - "attributes_to_return" + "n_epochs", + "max_steps_per_epoch", + "gradient_accumulation_steps" ], - "title": "QuerySpansRequest" + "title": "TrainingConfig", + "description": "Comprehensive configuration for the training process." }, - "Span": { + "PreferenceOptimizeRequest": { "type": "object", "properties": { - "span_id": { - "type": "string", - "description": "Unique identifier for the span" - }, - "trace_id": { + "job_uuid": { "type": "string", - "description": "Unique identifier for the trace this span belongs to" + "description": "The UUID of the job to create." }, - "parent_span_id": { + "finetuned_model": { "type": "string", - "description": "(Optional) Unique identifier for the parent span, if this is a child span" + "description": "The model to fine-tune." }, - "name": { - "type": "string", - "description": "Human-readable name describing the operation this span represents" + "algorithm_config": { + "$ref": "#/components/schemas/DPOAlignmentConfig", + "description": "The algorithm configuration." }, - "start_time": { - "type": "string", - "format": "date-time", - "description": "Timestamp when the operation began" + "training_config": { + "$ref": "#/components/schemas/TrainingConfig", + "description": "The training configuration." }, - "end_time": { - "type": "string", - "format": "date-time", - "description": "(Optional) Timestamp when the operation finished, if completed" + "hyperparam_search_config": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + }, + "description": "The hyperparam search configuration." }, - "attributes": { + "logger_config": { "type": "object", "additionalProperties": { "oneOf": [ @@ -6063,128 +5218,144 @@ } ] }, - "description": "(Optional) Key-value pairs containing additional metadata about the span" + "description": "The logger configuration." } }, "additionalProperties": false, "required": [ - "span_id", - "trace_id", - "name", - "start_time" + "job_uuid", + "finetuned_model", + "algorithm_config", + "training_config", + "hyperparam_search_config", + "logger_config" ], - "title": "Span", - "description": "A span representing a single operation within a trace." + "title": "PreferenceOptimizeRequest" }, - "QuerySpansResponse": { + "PostTrainingJob": { "type": "object", "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Span" - }, - "description": "List of spans matching the query criteria" + "job_uuid": { + "type": "string" } }, "additionalProperties": false, "required": [ - "data" + "job_uuid" + ], + "title": "PostTrainingJob" + }, + "AlgorithmConfig": { + "oneOf": [ + { + "$ref": "#/components/schemas/LoraFinetuningConfig" + }, + { + "$ref": "#/components/schemas/QATFinetuningConfig" + } ], - "title": "QuerySpansResponse", - "description": "Response containing a list of spans." + "discriminator": { + "propertyName": "type", + "mapping": { + "LoRA": "#/components/schemas/LoraFinetuningConfig", + "QAT": "#/components/schemas/QATFinetuningConfig" + } + } }, - "SaveSpansToDatasetRequest": { + "LoraFinetuningConfig": { "type": "object", "properties": { - "attribute_filters": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QueryCondition" - }, - "description": "The attribute filters to apply to the spans." + "type": { + "type": "string", + "const": "LoRA", + "default": "LoRA", + "description": "Algorithm type identifier, always \"LoRA\"" }, - "attributes_to_save": { + "lora_attn_modules": { "type": "array", "items": { "type": "string" }, - "description": "The attributes to save to the dataset." + "description": "List of attention module names to apply LoRA to" }, - "dataset_id": { - "type": "string", - "description": "The ID of the dataset to save the spans 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)" }, - "max_depth": { + "alpha": { "type": "integer", - "description": "The maximum depth of the tree." + "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": [ - "attribute_filters", - "attributes_to_save", - "dataset_id" + "type", + "lora_attn_modules", + "apply_lora_to_mlp", + "apply_lora_to_output", + "rank", + "alpha" ], - "title": "SaveSpansToDatasetRequest" + "title": "LoraFinetuningConfig", + "description": "Configuration for Low-Rank Adaptation (LoRA) fine-tuning." }, - "GetSpanTreeRequest": { + "QATFinetuningConfig": { "type": "object", "properties": { - "attributes_to_return": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The attributes to return in the tree." + "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" }, - "max_depth": { + "group_size": { "type": "integer", - "description": "The maximum depth of the tree." + "description": "Size of groups for grouped quantization" } }, "additionalProperties": false, - "title": "GetSpanTreeRequest" - }, - "SpanStatus": { - "type": "string", - "enum": [ - "ok", - "error" + "required": [ + "type", + "quantizer_name", + "group_size" ], - "title": "SpanStatus", - "description": "The status of a span indicating whether it completed successfully or with an error." + "title": "QATFinetuningConfig", + "description": "Configuration for Quantization-Aware Training (QAT) fine-tuning." }, - "SpanWithStatus": { + "SupervisedFineTuneRequest": { "type": "object", "properties": { - "span_id": { - "type": "string", - "description": "Unique identifier for the span" - }, - "trace_id": { - "type": "string", - "description": "Unique identifier for the trace this span belongs to" - }, - "parent_span_id": { - "type": "string", - "description": "(Optional) Unique identifier for the parent span, if this is a child span" - }, - "name": { - "type": "string", - "description": "Human-readable name describing the operation this span represents" - }, - "start_time": { + "job_uuid": { "type": "string", - "format": "date-time", - "description": "Timestamp when the operation began" + "description": "The UUID of the job to create." }, - "end_time": { - "type": "string", - "format": "date-time", - "description": "(Optional) Timestamp when the operation finished, if completed" + "training_config": { + "$ref": "#/components/schemas/TrainingConfig", + "description": "The training configuration." }, - "attributes": { + "hyperparam_search_config": { "type": "object", "additionalProperties": { "oneOf": [ @@ -6208,118 +5379,55 @@ } ] }, - "description": "(Optional) Key-value pairs containing additional metadata about the span" + "description": "The hyperparam search configuration." }, - "status": { - "$ref": "#/components/schemas/SpanStatus", - "description": "(Optional) The current status of the span" - } - }, - "additionalProperties": false, - "required": [ - "span_id", - "trace_id", - "name", - "start_time" - ], - "title": "SpanWithStatus", - "description": "A span that includes status information." - }, - "QuerySpanTreeResponse": { - "type": "object", - "properties": { - "data": { + "logger_config": { "type": "object", "additionalProperties": { - "$ref": "#/components/schemas/SpanWithStatus" - }, - "description": "Dictionary mapping span IDs to spans with status information" - } - }, - "additionalProperties": false, - "required": [ - "data" - ], - "title": "QuerySpanTreeResponse", - "description": "Response containing a tree structure of spans." - }, - "QueryTracesRequest": { - "type": "object", - "properties": { - "attribute_filters": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QueryCondition" - }, - "description": "The attribute filters to apply to the traces." - }, - "limit": { - "type": "integer", - "description": "The limit of traces to return." - }, - "offset": { - "type": "integer", - "description": "The offset of the traces to return." - }, - "order_by": { - "type": "array", - "items": { - "type": "string" + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] }, - "description": "The order by of the traces to return." - } - }, - "additionalProperties": false, - "title": "QueryTracesRequest" - }, - "Trace": { - "type": "object", - "properties": { - "trace_id": { - "type": "string", - "description": "Unique identifier for the trace" + "description": "The logger configuration." }, - "root_span_id": { + "model": { "type": "string", - "description": "Unique identifier for the root span that started this trace" + "description": "The model to fine-tune." }, - "start_time": { + "checkpoint_dir": { "type": "string", - "format": "date-time", - "description": "Timestamp when the trace began" + "description": "The directory to save checkpoint(s) to." }, - "end_time": { - "type": "string", - "format": "date-time", - "description": "(Optional) Timestamp when the trace finished, if completed" - } - }, - "additionalProperties": false, - "required": [ - "trace_id", - "root_span_id", - "start_time" - ], - "title": "Trace", - "description": "A trace representing the complete execution path of a request across multiple operations." - }, - "QueryTracesResponse": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Trace" - }, - "description": "List of traces matching the query criteria" + "algorithm_config": { + "$ref": "#/components/schemas/AlgorithmConfig", + "description": "The algorithm configuration." } }, "additionalProperties": false, "required": [ - "data" + "job_uuid", + "training_config", + "hyperparam_search_config", + "logger_config" ], - "title": "QueryTracesResponse", - "description": "Response containing a list of traces." + "title": "SupervisedFineTuneRequest" } }, "responses": { @@ -6416,10 +5524,6 @@ { "name": "PostTraining (Coming Soon)", "description": "" - }, - { - "name": "Telemetry", - "description": "" } ], "x-tagGroups": [ @@ -6431,8 +5535,7 @@ "DatasetIO", "Datasets", "Eval", - "PostTraining (Coming Soon)", - "Telemetry" + "PostTraining (Coming Soon)" ] } ] diff --git a/docs/static/experimental-llama-stack-spec.yaml b/docs/static/experimental-llama-stack-spec.yaml index a08c0cc87e..7ee5a6cdf1 100644 --- a/docs/static/experimental-llama-stack-spec.yaml +++ b/docs/static/experimental-llama-stack-spec.yaml @@ -1224,238 +1224,6 @@ paths: $ref: '#/components/schemas/SupervisedFineTuneRequest' required: true deprecated: false - /v1alpha/telemetry/metrics/{metric_name}: - post: - responses: - '200': - description: A QueryMetricsResponse. - content: - application/json: - schema: - $ref: '#/components/schemas/QueryMetricsResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Telemetry - summary: Query metrics. - description: Query metrics. - parameters: - - name: metric_name - in: path - description: The name of the metric to query. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QueryMetricsRequest' - required: true - deprecated: false - /v1alpha/telemetry/spans: - post: - responses: - '200': - description: A QuerySpansResponse. - content: - application/json: - schema: - $ref: '#/components/schemas/QuerySpansResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Telemetry - summary: Query spans. - description: Query spans. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QuerySpansRequest' - required: true - deprecated: false - /v1alpha/telemetry/spans/export: - 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: - - Telemetry - summary: Save spans to a dataset. - description: Save spans to a dataset. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SaveSpansToDatasetRequest' - required: true - deprecated: false - /v1alpha/telemetry/spans/{span_id}/tree: - post: - responses: - '200': - description: A QuerySpanTreeResponse. - content: - application/json: - schema: - $ref: '#/components/schemas/QuerySpanTreeResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Telemetry - summary: Get a span tree by its ID. - description: Get a span tree by its ID. - parameters: - - name: span_id - in: path - description: The ID of the span to get the tree from. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetSpanTreeRequest' - required: true - deprecated: false - /v1alpha/telemetry/traces: - post: - responses: - '200': - description: A QueryTracesResponse. - content: - application/json: - schema: - $ref: '#/components/schemas/QueryTracesResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Telemetry - summary: Query traces. - description: Query traces. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QueryTracesRequest' - required: true - deprecated: false - /v1alpha/telemetry/traces/{trace_id}: - get: - responses: - '200': - description: A Trace. - content: - application/json: - schema: - $ref: '#/components/schemas/Trace' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Telemetry - summary: Get a trace by its ID. - description: Get a trace by its ID. - parameters: - - name: trace_id - in: path - description: The ID of the trace to get. - required: true - schema: - type: string - deprecated: false - /v1alpha/telemetry/traces/{trace_id}/spans/{span_id}: - get: - responses: - '200': - description: A Span. - content: - application/json: - schema: - $ref: '#/components/schemas/Span' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Telemetry - summary: Get a span by its ID. - description: Get a span by its ID. - parameters: - - name: trace_id - in: path - description: >- - The ID of the trace to get the span from. - required: true - schema: - type: string - - name: span_id - in: path - description: The ID of the span to get. - required: true - schema: - type: string - deprecated: false jsonSchemaDialect: >- https://json-schema.org/draft/2020-12/schema components: @@ -4249,434 +4017,6 @@ components: - hyperparam_search_config - logger_config title: SupervisedFineTuneRequest - QueryMetricsRequest: - type: object - properties: - start_time: - type: integer - description: The start time of the metric to query. - end_time: - type: integer - description: The end time of the metric to query. - granularity: - type: string - description: The granularity of the metric to query. - query_type: - type: string - enum: - - range - - instant - description: The type of query to perform. - label_matchers: - type: array - items: - type: object - properties: - name: - type: string - description: The name of the label to match - value: - type: string - description: The value to match against - operator: - type: string - enum: - - '=' - - '!=' - - =~ - - '!~' - description: >- - The comparison operator to use for matching - default: '=' - additionalProperties: false - required: - - name - - value - - operator - title: MetricLabelMatcher - description: >- - A matcher for filtering metrics by label values. - description: >- - The label matchers to apply to the metric. - additionalProperties: false - required: - - start_time - - query_type - title: QueryMetricsRequest - MetricDataPoint: - type: object - properties: - timestamp: - type: integer - description: >- - Unix timestamp when the metric value was recorded - value: - type: number - description: >- - The numeric value of the metric at this timestamp - unit: - type: string - additionalProperties: false - required: - - timestamp - - value - - unit - title: MetricDataPoint - description: >- - A single data point in a metric time series. - MetricLabel: - type: object - properties: - name: - type: string - description: The name of the label - value: - type: string - description: The value of the label - additionalProperties: false - required: - - name - - value - title: MetricLabel - description: A label associated with a metric. - MetricSeries: - type: object - properties: - metric: - type: string - description: The name of the metric - labels: - type: array - items: - $ref: '#/components/schemas/MetricLabel' - description: >- - List of labels associated with this metric series - values: - type: array - items: - $ref: '#/components/schemas/MetricDataPoint' - description: >- - List of data points in chronological order - additionalProperties: false - required: - - metric - - labels - - values - title: MetricSeries - description: A time series of metric data points. - QueryMetricsResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/MetricSeries' - description: >- - List of metric series matching the query criteria - additionalProperties: false - required: - - data - title: QueryMetricsResponse - description: >- - Response containing metric time series data. - QueryCondition: - type: object - properties: - key: - type: string - description: The attribute key to filter on - op: - $ref: '#/components/schemas/QueryConditionOp' - description: The comparison operator to apply - value: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The value to compare against - additionalProperties: false - required: - - key - - op - - value - title: QueryCondition - description: A condition for filtering query results. - QueryConditionOp: - type: string - enum: - - eq - - ne - - gt - - lt - title: QueryConditionOp - description: >- - Comparison operators for query conditions. - QuerySpansRequest: - type: object - properties: - attribute_filters: - type: array - items: - $ref: '#/components/schemas/QueryCondition' - description: >- - The attribute filters to apply to the spans. - attributes_to_return: - type: array - items: - type: string - description: The attributes to return in the spans. - max_depth: - type: integer - description: The maximum depth of the tree. - additionalProperties: false - required: - - attribute_filters - - attributes_to_return - title: QuerySpansRequest - Span: - type: object - properties: - span_id: - type: string - description: Unique identifier for the span - trace_id: - type: string - description: >- - Unique identifier for the trace this span belongs to - parent_span_id: - type: string - description: >- - (Optional) Unique identifier for the parent span, if this is a child span - name: - type: string - description: >- - Human-readable name describing the operation this span represents - start_time: - type: string - format: date-time - description: Timestamp when the operation began - end_time: - type: string - format: date-time - description: >- - (Optional) Timestamp when the operation finished, if completed - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Key-value pairs containing additional metadata about the span - additionalProperties: false - required: - - span_id - - trace_id - - name - - start_time - title: Span - description: >- - A span representing a single operation within a trace. - QuerySpansResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/Span' - description: >- - List of spans matching the query criteria - additionalProperties: false - required: - - data - title: QuerySpansResponse - description: Response containing a list of spans. - SaveSpansToDatasetRequest: - type: object - properties: - attribute_filters: - type: array - items: - $ref: '#/components/schemas/QueryCondition' - description: >- - The attribute filters to apply to the spans. - attributes_to_save: - type: array - items: - type: string - description: The attributes to save to the dataset. - dataset_id: - type: string - description: >- - The ID of the dataset to save the spans to. - max_depth: - type: integer - description: The maximum depth of the tree. - additionalProperties: false - required: - - attribute_filters - - attributes_to_save - - dataset_id - title: SaveSpansToDatasetRequest - GetSpanTreeRequest: - type: object - properties: - attributes_to_return: - type: array - items: - type: string - description: The attributes to return in the tree. - max_depth: - type: integer - description: The maximum depth of the tree. - additionalProperties: false - title: GetSpanTreeRequest - SpanStatus: - type: string - enum: - - ok - - error - title: SpanStatus - description: >- - The status of a span indicating whether it completed successfully or with - an error. - SpanWithStatus: - type: object - properties: - span_id: - type: string - description: Unique identifier for the span - trace_id: - type: string - description: >- - Unique identifier for the trace this span belongs to - parent_span_id: - type: string - description: >- - (Optional) Unique identifier for the parent span, if this is a child span - name: - type: string - description: >- - Human-readable name describing the operation this span represents - start_time: - type: string - format: date-time - description: Timestamp when the operation began - end_time: - type: string - format: date-time - description: >- - (Optional) Timestamp when the operation finished, if completed - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Key-value pairs containing additional metadata about the span - status: - $ref: '#/components/schemas/SpanStatus' - description: >- - (Optional) The current status of the span - additionalProperties: false - required: - - span_id - - trace_id - - name - - start_time - title: SpanWithStatus - description: A span that includes status information. - QuerySpanTreeResponse: - type: object - properties: - data: - type: object - additionalProperties: - $ref: '#/components/schemas/SpanWithStatus' - description: >- - Dictionary mapping span IDs to spans with status information - additionalProperties: false - required: - - data - title: QuerySpanTreeResponse - description: >- - Response containing a tree structure of spans. - QueryTracesRequest: - type: object - properties: - attribute_filters: - type: array - items: - $ref: '#/components/schemas/QueryCondition' - description: >- - The attribute filters to apply to the traces. - limit: - type: integer - description: The limit of traces to return. - offset: - type: integer - description: The offset of the traces to return. - order_by: - type: array - items: - type: string - description: The order by of the traces to return. - additionalProperties: false - title: QueryTracesRequest - Trace: - type: object - properties: - trace_id: - type: string - description: Unique identifier for the trace - root_span_id: - type: string - description: >- - Unique identifier for the root span that started this trace - start_time: - type: string - format: date-time - description: Timestamp when the trace began - end_time: - type: string - format: date-time - description: >- - (Optional) Timestamp when the trace finished, if completed - additionalProperties: false - required: - - trace_id - - root_span_id - - start_time - title: Trace - description: >- - A trace representing the complete execution path of a request across multiple - operations. - QueryTracesResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/Trace' - description: >- - List of traces matching the query criteria - additionalProperties: false - required: - - data - title: QueryTracesResponse - description: Response containing a list of traces. responses: BadRequest400: description: The request was invalid or malformed @@ -4784,8 +4124,6 @@ tags: Llama Stack Evaluation API for running evaluations on model and agent candidates. - name: PostTraining (Coming Soon) description: '' - - name: Telemetry - description: '' x-tagGroups: - name: Operations tags: @@ -4795,4 +4133,3 @@ x-tagGroups: - Datasets - Eval - PostTraining (Coming Soon) - - Telemetry diff --git a/docs/static/llama-stack-spec.html b/docs/static/llama-stack-spec.html index 24e88b5f6c..9887a57789 100644 --- a/docs/static/llama-stack-spec.html +++ b/docs/static/llama-stack-spec.html @@ -2525,44 +2525,6 @@ "deprecated": false } }, - "/v1/telemetry/events": { - "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": [ - "Telemetry" - ], - "summary": "Log an event.", - "description": "Log an event.", - "parameters": [], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LogEventRequest" - } - } - }, - "required": true - }, - "deprecated": false - } - }, "/v1/tool-runtime/invoke": { "post": { "responses": { @@ -11172,354 +11134,6 @@ "title": "SyntheticDataGenerationResponse", "description": "Response from the synthetic data generation. Batch of (prompt, response, score) tuples that pass the threshold." }, - "Event": { - "oneOf": [ - { - "$ref": "#/components/schemas/UnstructuredLogEvent" - }, - { - "$ref": "#/components/schemas/MetricEvent" - }, - { - "$ref": "#/components/schemas/StructuredLogEvent" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "unstructured_log": "#/components/schemas/UnstructuredLogEvent", - "metric": "#/components/schemas/MetricEvent", - "structured_log": "#/components/schemas/StructuredLogEvent" - } - } - }, - "EventType": { - "type": "string", - "enum": [ - "unstructured_log", - "structured_log", - "metric" - ], - "title": "EventType", - "description": "The type of telemetry event being logged." - }, - "LogSeverity": { - "type": "string", - "enum": [ - "verbose", - "debug", - "info", - "warn", - "error", - "critical" - ], - "title": "LogSeverity", - "description": "The severity level of a log message." - }, - "MetricEvent": { - "type": "object", - "properties": { - "trace_id": { - "type": "string", - "description": "Unique identifier for the trace this event belongs to" - }, - "span_id": { - "type": "string", - "description": "Unique identifier for the span this event belongs to" - }, - "timestamp": { - "type": "string", - "format": "date-time", - "description": "Timestamp when the event occurred" - }, - "attributes": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "description": "(Optional) Key-value pairs containing additional metadata about the event" - }, - "type": { - "$ref": "#/components/schemas/EventType", - "const": "metric", - "default": "metric", - "description": "Event type identifier set to METRIC" - }, - "metric": { - "type": "string", - "description": "The name of the metric being measured" - }, - "value": { - "oneOf": [ - { - "type": "integer" - }, - { - "type": "number" - } - ], - "description": "The numeric value of the metric measurement" - }, - "unit": { - "type": "string", - "description": "The unit of measurement for the metric value" - } - }, - "additionalProperties": false, - "required": [ - "trace_id", - "span_id", - "timestamp", - "type", - "metric", - "value", - "unit" - ], - "title": "MetricEvent", - "description": "A metric event containing a measured value." - }, - "SpanEndPayload": { - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/StructuredLogType", - "const": "span_end", - "default": "span_end", - "description": "Payload type identifier set to SPAN_END" - }, - "status": { - "$ref": "#/components/schemas/SpanStatus", - "description": "The final status of the span indicating success or failure" - } - }, - "additionalProperties": false, - "required": [ - "type", - "status" - ], - "title": "SpanEndPayload", - "description": "Payload for a span end event." - }, - "SpanStartPayload": { - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/StructuredLogType", - "const": "span_start", - "default": "span_start", - "description": "Payload type identifier set to SPAN_START" - }, - "name": { - "type": "string", - "description": "Human-readable name describing the operation this span represents" - }, - "parent_span_id": { - "type": "string", - "description": "(Optional) Unique identifier for the parent span, if this is a child span" - } - }, - "additionalProperties": false, - "required": [ - "type", - "name" - ], - "title": "SpanStartPayload", - "description": "Payload for a span start event." - }, - "SpanStatus": { - "type": "string", - "enum": [ - "ok", - "error" - ], - "title": "SpanStatus", - "description": "The status of a span indicating whether it completed successfully or with an error." - }, - "StructuredLogEvent": { - "type": "object", - "properties": { - "trace_id": { - "type": "string", - "description": "Unique identifier for the trace this event belongs to" - }, - "span_id": { - "type": "string", - "description": "Unique identifier for the span this event belongs to" - }, - "timestamp": { - "type": "string", - "format": "date-time", - "description": "Timestamp when the event occurred" - }, - "attributes": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "description": "(Optional) Key-value pairs containing additional metadata about the event" - }, - "type": { - "$ref": "#/components/schemas/EventType", - "const": "structured_log", - "default": "structured_log", - "description": "Event type identifier set to STRUCTURED_LOG" - }, - "payload": { - "oneOf": [ - { - "$ref": "#/components/schemas/SpanStartPayload" - }, - { - "$ref": "#/components/schemas/SpanEndPayload" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "span_start": "#/components/schemas/SpanStartPayload", - "span_end": "#/components/schemas/SpanEndPayload" - } - }, - "description": "The structured payload data for the log event" - } - }, - "additionalProperties": false, - "required": [ - "trace_id", - "span_id", - "timestamp", - "type", - "payload" - ], - "title": "StructuredLogEvent", - "description": "A structured log event containing typed payload data." - }, - "StructuredLogType": { - "type": "string", - "enum": [ - "span_start", - "span_end" - ], - "title": "StructuredLogType", - "description": "The type of structured log event payload." - }, - "UnstructuredLogEvent": { - "type": "object", - "properties": { - "trace_id": { - "type": "string", - "description": "Unique identifier for the trace this event belongs to" - }, - "span_id": { - "type": "string", - "description": "Unique identifier for the span this event belongs to" - }, - "timestamp": { - "type": "string", - "format": "date-time", - "description": "Timestamp when the event occurred" - }, - "attributes": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "description": "(Optional) Key-value pairs containing additional metadata about the event" - }, - "type": { - "$ref": "#/components/schemas/EventType", - "const": "unstructured_log", - "default": "unstructured_log", - "description": "Event type identifier set to UNSTRUCTURED_LOG" - }, - "message": { - "type": "string", - "description": "The log message text" - }, - "severity": { - "$ref": "#/components/schemas/LogSeverity", - "description": "The severity level of the log message" - } - }, - "additionalProperties": false, - "required": [ - "trace_id", - "span_id", - "timestamp", - "type", - "message", - "severity" - ], - "title": "UnstructuredLogEvent", - "description": "An unstructured log event containing a simple text message." - }, - "LogEventRequest": { - "type": "object", - "properties": { - "event": { - "$ref": "#/components/schemas/Event", - "description": "The event to log." - }, - "ttl_seconds": { - "type": "integer", - "description": "The time to live of the event." - } - }, - "additionalProperties": false, - "required": [ - "event", - "ttl_seconds" - ], - "title": "LogEventRequest" - }, "InvokeToolRequest": { "type": "object", "properties": { @@ -13655,10 +13269,6 @@ "name": "SyntheticDataGeneration (Coming Soon)", "description": "" }, - { - "name": "Telemetry", - "description": "" - }, { "name": "ToolGroups", "description": "" @@ -13689,7 +13299,6 @@ "ScoringFunctions", "Shields", "SyntheticDataGeneration (Coming Soon)", - "Telemetry", "ToolGroups", "ToolRuntime", "VectorIO" diff --git a/docs/static/llama-stack-spec.yaml b/docs/static/llama-stack-spec.yaml index ac16410793..98e5f9cbb4 100644 --- a/docs/static/llama-stack-spec.yaml +++ b/docs/static/llama-stack-spec.yaml @@ -1944,33 +1944,6 @@ paths: $ref: '#/components/schemas/SyntheticDataGenerateRequest' required: true deprecated: false - /v1/telemetry/events: - 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: - - Telemetry - summary: Log an event. - description: Log an event. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/LogEventRequest' - required: true - deprecated: false /v1/tool-runtime/invoke: post: responses: @@ -8565,267 +8538,6 @@ components: description: >- Response from the synthetic data generation. Batch of (prompt, response, score) tuples that pass the threshold. - Event: - oneOf: - - $ref: '#/components/schemas/UnstructuredLogEvent' - - $ref: '#/components/schemas/MetricEvent' - - $ref: '#/components/schemas/StructuredLogEvent' - discriminator: - propertyName: type - mapping: - unstructured_log: '#/components/schemas/UnstructuredLogEvent' - metric: '#/components/schemas/MetricEvent' - structured_log: '#/components/schemas/StructuredLogEvent' - EventType: - type: string - enum: - - unstructured_log - - structured_log - - metric - title: EventType - description: >- - The type of telemetry event being logged. - LogSeverity: - type: string - enum: - - verbose - - debug - - info - - warn - - error - - critical - title: LogSeverity - description: The severity level of a log message. - MetricEvent: - type: object - properties: - trace_id: - type: string - description: >- - Unique identifier for the trace this event belongs to - span_id: - type: string - description: >- - Unique identifier for the span this event belongs to - timestamp: - type: string - format: date-time - description: Timestamp when the event occurred - attributes: - type: object - additionalProperties: - oneOf: - - type: string - - type: integer - - type: number - - type: boolean - - type: 'null' - description: >- - (Optional) Key-value pairs containing additional metadata about the event - type: - $ref: '#/components/schemas/EventType' - const: metric - default: metric - description: Event type identifier set to METRIC - metric: - type: string - description: The name of the metric being measured - value: - oneOf: - - type: integer - - type: number - description: >- - The numeric value of the metric measurement - unit: - type: string - description: >- - The unit of measurement for the metric value - additionalProperties: false - required: - - trace_id - - span_id - - timestamp - - type - - metric - - value - - unit - title: MetricEvent - description: >- - A metric event containing a measured value. - SpanEndPayload: - type: object - properties: - type: - $ref: '#/components/schemas/StructuredLogType' - const: span_end - default: span_end - description: Payload type identifier set to SPAN_END - status: - $ref: '#/components/schemas/SpanStatus' - description: >- - The final status of the span indicating success or failure - additionalProperties: false - required: - - type - - status - title: SpanEndPayload - description: Payload for a span end event. - SpanStartPayload: - type: object - properties: - type: - $ref: '#/components/schemas/StructuredLogType' - const: span_start - default: span_start - description: >- - Payload type identifier set to SPAN_START - name: - type: string - description: >- - Human-readable name describing the operation this span represents - parent_span_id: - type: string - description: >- - (Optional) Unique identifier for the parent span, if this is a child span - additionalProperties: false - required: - - type - - name - title: SpanStartPayload - description: Payload for a span start event. - SpanStatus: - type: string - enum: - - ok - - error - title: SpanStatus - description: >- - The status of a span indicating whether it completed successfully or with - an error. - StructuredLogEvent: - type: object - properties: - trace_id: - type: string - description: >- - Unique identifier for the trace this event belongs to - span_id: - type: string - description: >- - Unique identifier for the span this event belongs to - timestamp: - type: string - format: date-time - description: Timestamp when the event occurred - attributes: - type: object - additionalProperties: - oneOf: - - type: string - - type: integer - - type: number - - type: boolean - - type: 'null' - description: >- - (Optional) Key-value pairs containing additional metadata about the event - type: - $ref: '#/components/schemas/EventType' - const: structured_log - default: structured_log - description: >- - Event type identifier set to STRUCTURED_LOG - payload: - oneOf: - - $ref: '#/components/schemas/SpanStartPayload' - - $ref: '#/components/schemas/SpanEndPayload' - discriminator: - propertyName: type - mapping: - span_start: '#/components/schemas/SpanStartPayload' - span_end: '#/components/schemas/SpanEndPayload' - description: >- - The structured payload data for the log event - additionalProperties: false - required: - - trace_id - - span_id - - timestamp - - type - - payload - title: StructuredLogEvent - description: >- - A structured log event containing typed payload data. - StructuredLogType: - type: string - enum: - - span_start - - span_end - title: StructuredLogType - description: >- - The type of structured log event payload. - UnstructuredLogEvent: - type: object - properties: - trace_id: - type: string - description: >- - Unique identifier for the trace this event belongs to - span_id: - type: string - description: >- - Unique identifier for the span this event belongs to - timestamp: - type: string - format: date-time - description: Timestamp when the event occurred - attributes: - type: object - additionalProperties: - oneOf: - - type: string - - type: integer - - type: number - - type: boolean - - type: 'null' - description: >- - (Optional) Key-value pairs containing additional metadata about the event - type: - $ref: '#/components/schemas/EventType' - const: unstructured_log - default: unstructured_log - description: >- - Event type identifier set to UNSTRUCTURED_LOG - message: - type: string - description: The log message text - severity: - $ref: '#/components/schemas/LogSeverity' - description: The severity level of the log message - additionalProperties: false - required: - - trace_id - - span_id - - timestamp - - type - - message - - severity - title: UnstructuredLogEvent - description: >- - An unstructured log event containing a simple text message. - LogEventRequest: - type: object - properties: - event: - $ref: '#/components/schemas/Event' - description: The event to log. - ttl_seconds: - type: integer - description: The time to live of the event. - additionalProperties: false - required: - - event - - ttl_seconds - title: LogEventRequest InvokeToolRequest: type: object properties: @@ -10465,8 +10177,6 @@ tags: description: '' - name: SyntheticDataGeneration (Coming Soon) description: '' - - name: Telemetry - description: '' - name: ToolGroups description: '' - name: ToolRuntime @@ -10489,7 +10199,6 @@ x-tagGroups: - ScoringFunctions - Shields - SyntheticDataGeneration (Coming Soon) - - Telemetry - ToolGroups - ToolRuntime - VectorIO diff --git a/docs/static/stainless-llama-stack-spec.html b/docs/static/stainless-llama-stack-spec.html index 4184f13796..932d9fd967 100644 --- a/docs/static/stainless-llama-stack-spec.html +++ b/docs/static/stainless-llama-stack-spec.html @@ -2525,44 +2525,6 @@ "deprecated": false } }, - "/v1/telemetry/events": { - "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": [ - "Telemetry" - ], - "summary": "Log an event.", - "description": "Log an event.", - "parameters": [], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LogEventRequest" - } - } - }, - "required": true - }, - "deprecated": false - } - }, "/v1/tool-runtime/invoke": { "post": { "responses": { @@ -5714,600 +5676,263 @@ }, "deprecated": false } - }, - "/v1alpha/telemetry/metrics/{metric_name}": { - "post": { - "responses": { - "200": { - "description": "A QueryMetricsResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryMetricsResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" + } + }, + "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema", + "components": { + "schemas": { + "Error": { + "type": "object", + "properties": { + "status": { + "type": "integer", + "description": "HTTP status code" }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" + "title": { + "type": "string", + "description": "Error title, a short summary of the error which is invariant for an error type" }, - "500": { - "$ref": "#/components/responses/InternalServerError500" + "detail": { + "type": "string", + "description": "Error detail, a longer human-readable description of the error" }, - "default": { - "$ref": "#/components/responses/DefaultError" + "instance": { + "type": "string", + "description": "(Optional) A URL which can be used to retrieve more information about the specific occurrence of the error" } }, - "tags": [ - "Telemetry" + "additionalProperties": false, + "required": [ + "status", + "title", + "detail" ], - "summary": "Query metrics.", - "description": "Query metrics.", - "parameters": [ - { - "name": "metric_name", - "in": "path", - "description": "The name of the metric to query.", - "required": true, - "schema": { - "type": "string" - } - } + "title": "Error", + "description": "Error response from the API. Roughly follows RFC 7807." + }, + "Order": { + "type": "string", + "enum": [ + "asc", + "desc" ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryMetricsRequest" - } - } - }, - "required": true - }, - "deprecated": false - } - }, - "/v1alpha/telemetry/spans": { - "post": { - "responses": { - "200": { - "description": "A QuerySpansResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QuerySpansResponse" + "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" }, - "400": { - "$ref": "#/components/responses/BadRequest400" + "has_more": { + "type": "boolean", + "description": "Whether there are more completions available beyond this list" }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" + "first_id": { + "type": "string", + "description": "ID of the first completion in this list" }, - "500": { - "$ref": "#/components/responses/InternalServerError500" + "last_id": { + "type": "string", + "description": "ID of the last completion in this list" }, - "default": { - "$ref": "#/components/responses/DefaultError" + "object": { + "type": "string", + "const": "list", + "default": "list", + "description": "Must be \"list\" to identify this as a list response" } }, - "tags": [ - "Telemetry" + "additionalProperties": false, + "required": [ + "data", + "has_more", + "first_id", + "last_id", + "object" ], - "summary": "Query spans.", - "description": "Query spans.", - "parameters": [], - "requestBody": { + "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": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QuerySpansRequest" + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" + } } - } - }, - "required": true - }, - "deprecated": false - } - }, - "/v1alpha/telemetry/spans/export": { - "post": { - "responses": { - "200": { - "description": "OK" - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" + ], + "description": "The content of the model's response" }, - "500": { - "$ref": "#/components/responses/InternalServerError500" + "name": { + "type": "string", + "description": "(Optional) The name of the assistant message participant." }, - "default": { - "$ref": "#/components/responses/DefaultError" - } - }, - "tags": [ - "Telemetry" - ], - "summary": "Save spans to a dataset.", - "description": "Save spans to a dataset.", - "parameters": [], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SaveSpansToDatasetRequest" - } - } - }, - "required": true - }, - "deprecated": false - } - }, - "/v1alpha/telemetry/spans/{span_id}/tree": { - "post": { - "responses": { - "200": { - "description": "A QuerySpanTreeResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QuerySpanTreeResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "$ref": "#/components/responses/DefaultError" + "tool_calls": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" + }, + "description": "List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object." } }, - "tags": [ - "Telemetry" - ], - "summary": "Get a span tree by its ID.", - "description": "Get a span tree by its ID.", - "parameters": [ - { - "name": "span_id", - "in": "path", - "description": "The ID of the span to get the tree from.", - "required": true, - "schema": { - "type": "string" - } - } + "additionalProperties": false, + "required": [ + "role" ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/GetSpanTreeRequest" - } - } - }, - "required": true - }, - "deprecated": false - } - }, - "/v1alpha/telemetry/traces": { - "post": { - "responses": { - "200": { - "description": "A QueryTracesResponse.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryTracesResponse" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" + "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" }, - "default": { - "$ref": "#/components/responses/DefaultError" + "image_url": { + "$ref": "#/components/schemas/OpenAIImageURL", + "description": "Image URL specification and processing details" } }, - "tags": [ - "Telemetry" + "additionalProperties": false, + "required": [ + "type", + "image_url" ], - "summary": "Query traces.", - "description": "Query traces.", - "parameters": [], - "requestBody": { - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueryTracesRequest" - } - } - }, - "required": true - }, - "deprecated": false - } - }, - "/v1alpha/telemetry/traces/{trace_id}": { - "get": { - "responses": { - "200": { - "description": "A Trace.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Trace" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" + "title": "OpenAIChatCompletionContentPartImageParam", + "description": "Image content part for OpenAI-compatible chat completion messages." + }, + "OpenAIChatCompletionContentPartParam": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" }, - "500": { - "$ref": "#/components/responses/InternalServerError500" + { + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" }, - "default": { - "$ref": "#/components/responses/DefaultError" - } - }, - "tags": [ - "Telemetry" - ], - "summary": "Get a trace by its ID.", - "description": "Get a trace by its ID.", - "parameters": [ { - "name": "trace_id", - "in": "path", - "description": "The ID of the trace to get.", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/schemas/OpenAIFile" } ], - "deprecated": false - } - }, - "/v1alpha/telemetry/traces/{trace_id}/spans/{span_id}": { - "get": { - "responses": { - "200": { - "description": "A Span.", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Span" - } - } - } - }, - "400": { - "$ref": "#/components/responses/BadRequest400" - }, - "429": { - "$ref": "#/components/responses/TooManyRequests429" - }, - "500": { - "$ref": "#/components/responses/InternalServerError500" - }, - "default": { - "$ref": "#/components/responses/DefaultError" + "discriminator": { + "propertyName": "type", + "mapping": { + "text": "#/components/schemas/OpenAIChatCompletionContentPartTextParam", + "image_url": "#/components/schemas/OpenAIChatCompletionContentPartImageParam", + "file": "#/components/schemas/OpenAIFile" } - }, - "tags": [ - "Telemetry" - ], - "summary": "Get a span by its ID.", - "description": "Get a span by its ID.", - "parameters": [ - { - "name": "trace_id", - "in": "path", - "description": "The ID of the trace to get the span from.", - "required": true, - "schema": { - "type": "string" - } + } + }, + "OpenAIChatCompletionContentPartTextParam": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "text", + "default": "text", + "description": "Must be \"text\" to identify this as text content" }, - { - "name": "span_id", - "in": "path", - "description": "The ID of the span to get.", - "required": true, - "schema": { - "type": "string" - } + "text": { + "type": "string", + "description": "The text content of the message" } + }, + "additionalProperties": false, + "required": [ + "type", + "text" ], - "deprecated": false - } - } - }, - "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema", - "components": { - "schemas": { - "Error": { + "title": "OpenAIChatCompletionContentPartTextParam", + "description": "Text content part for OpenAI-compatible chat completion messages." + }, + "OpenAIChatCompletionToolCall": { "type": "object", "properties": { - "status": { + "index": { "type": "integer", - "description": "HTTP status code" + "description": "(Optional) Index of the tool call in the list" }, - "title": { + "id": { "type": "string", - "description": "Error title, a short summary of the error which is invariant for an error type" + "description": "(Optional) Unique identifier for the tool call" }, - "detail": { + "type": { "type": "string", - "description": "Error detail, a longer human-readable description of the error" + "const": "function", + "default": "function", + "description": "Must be \"function\" to identify this as a function call" }, - "instance": { - "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": { - "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": { - "type": "string", - "const": "assistant", - "default": "assistant", - "description": "Must be \"assistant\" to identify this as the model's response" - }, - "content": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - } - } - ], - "description": "The content of the model's response" - }, - "name": { - "type": "string", - "description": "(Optional) The name of the assistant message participant." - }, - "tool_calls": { - "type": "array", - "items": { - "$ref": "#/components/schemas/OpenAIChatCompletionToolCall" - }, - "description": "List of tool calls. Each tool call is an OpenAIChatCompletionToolCall object." - } - }, - "additionalProperties": false, - "required": [ - "role" - ], - "title": "OpenAIAssistantMessageParam", - "description": "A message containing the model's (assistant) response in an OpenAI-compatible chat completion request." - }, - "OpenAIChatCompletionContentPartImageParam": { - "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" + "function": { + "$ref": "#/components/schemas/OpenAIChatCompletionToolCallFunction", + "description": "(Optional) Function call details" } }, "additionalProperties": false, @@ -13181,355 +12806,7 @@ "title": "SyntheticDataGenerationResponse", "description": "Response from the synthetic data generation. Batch of (prompt, response, score) tuples that pass the threshold." }, - "Event": { - "oneOf": [ - { - "$ref": "#/components/schemas/UnstructuredLogEvent" - }, - { - "$ref": "#/components/schemas/MetricEvent" - }, - { - "$ref": "#/components/schemas/StructuredLogEvent" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "unstructured_log": "#/components/schemas/UnstructuredLogEvent", - "metric": "#/components/schemas/MetricEvent", - "structured_log": "#/components/schemas/StructuredLogEvent" - } - } - }, - "EventType": { - "type": "string", - "enum": [ - "unstructured_log", - "structured_log", - "metric" - ], - "title": "EventType", - "description": "The type of telemetry event being logged." - }, - "LogSeverity": { - "type": "string", - "enum": [ - "verbose", - "debug", - "info", - "warn", - "error", - "critical" - ], - "title": "LogSeverity", - "description": "The severity level of a log message." - }, - "MetricEvent": { - "type": "object", - "properties": { - "trace_id": { - "type": "string", - "description": "Unique identifier for the trace this event belongs to" - }, - "span_id": { - "type": "string", - "description": "Unique identifier for the span this event belongs to" - }, - "timestamp": { - "type": "string", - "format": "date-time", - "description": "Timestamp when the event occurred" - }, - "attributes": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "description": "(Optional) Key-value pairs containing additional metadata about the event" - }, - "type": { - "$ref": "#/components/schemas/EventType", - "const": "metric", - "default": "metric", - "description": "Event type identifier set to METRIC" - }, - "metric": { - "type": "string", - "description": "The name of the metric being measured" - }, - "value": { - "oneOf": [ - { - "type": "integer" - }, - { - "type": "number" - } - ], - "description": "The numeric value of the metric measurement" - }, - "unit": { - "type": "string", - "description": "The unit of measurement for the metric value" - } - }, - "additionalProperties": false, - "required": [ - "trace_id", - "span_id", - "timestamp", - "type", - "metric", - "value", - "unit" - ], - "title": "MetricEvent", - "description": "A metric event containing a measured value." - }, - "SpanEndPayload": { - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/StructuredLogType", - "const": "span_end", - "default": "span_end", - "description": "Payload type identifier set to SPAN_END" - }, - "status": { - "$ref": "#/components/schemas/SpanStatus", - "description": "The final status of the span indicating success or failure" - } - }, - "additionalProperties": false, - "required": [ - "type", - "status" - ], - "title": "SpanEndPayload", - "description": "Payload for a span end event." - }, - "SpanStartPayload": { - "type": "object", - "properties": { - "type": { - "$ref": "#/components/schemas/StructuredLogType", - "const": "span_start", - "default": "span_start", - "description": "Payload type identifier set to SPAN_START" - }, - "name": { - "type": "string", - "description": "Human-readable name describing the operation this span represents" - }, - "parent_span_id": { - "type": "string", - "description": "(Optional) Unique identifier for the parent span, if this is a child span" - } - }, - "additionalProperties": false, - "required": [ - "type", - "name" - ], - "title": "SpanStartPayload", - "description": "Payload for a span start event." - }, - "SpanStatus": { - "type": "string", - "enum": [ - "ok", - "error" - ], - "title": "SpanStatus", - "description": "The status of a span indicating whether it completed successfully or with an error." - }, - "StructuredLogEvent": { - "type": "object", - "properties": { - "trace_id": { - "type": "string", - "description": "Unique identifier for the trace this event belongs to" - }, - "span_id": { - "type": "string", - "description": "Unique identifier for the span this event belongs to" - }, - "timestamp": { - "type": "string", - "format": "date-time", - "description": "Timestamp when the event occurred" - }, - "attributes": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "description": "(Optional) Key-value pairs containing additional metadata about the event" - }, - "type": { - "$ref": "#/components/schemas/EventType", - "const": "structured_log", - "default": "structured_log", - "description": "Event type identifier set to STRUCTURED_LOG" - }, - "payload": { - "oneOf": [ - { - "$ref": "#/components/schemas/SpanStartPayload" - }, - { - "$ref": "#/components/schemas/SpanEndPayload" - } - ], - "discriminator": { - "propertyName": "type", - "mapping": { - "span_start": "#/components/schemas/SpanStartPayload", - "span_end": "#/components/schemas/SpanEndPayload" - } - }, - "description": "The structured payload data for the log event" - } - }, - "additionalProperties": false, - "required": [ - "trace_id", - "span_id", - "timestamp", - "type", - "payload" - ], - "title": "StructuredLogEvent", - "description": "A structured log event containing typed payload data." - }, - "StructuredLogType": { - "type": "string", - "enum": [ - "span_start", - "span_end" - ], - "title": "StructuredLogType", - "description": "The type of structured log event payload." - }, - "UnstructuredLogEvent": { - "type": "object", - "properties": { - "trace_id": { - "type": "string", - "description": "Unique identifier for the trace this event belongs to" - }, - "span_id": { - "type": "string", - "description": "Unique identifier for the span this event belongs to" - }, - "timestamp": { - "type": "string", - "format": "date-time", - "description": "Timestamp when the event occurred" - }, - "attributes": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "boolean" - }, - { - "type": "null" - } - ] - }, - "description": "(Optional) Key-value pairs containing additional metadata about the event" - }, - "type": { - "$ref": "#/components/schemas/EventType", - "const": "unstructured_log", - "default": "unstructured_log", - "description": "Event type identifier set to UNSTRUCTURED_LOG" - }, - "message": { - "type": "string", - "description": "The log message text" - }, - "severity": { - "$ref": "#/components/schemas/LogSeverity", - "description": "The severity level of the log message" - } - }, - "additionalProperties": false, - "required": [ - "trace_id", - "span_id", - "timestamp", - "type", - "message", - "severity" - ], - "title": "UnstructuredLogEvent", - "description": "An unstructured log event containing a simple text message." - }, - "LogEventRequest": { - "type": "object", - "properties": { - "event": { - "$ref": "#/components/schemas/Event", - "description": "The event to log." - }, - "ttl_seconds": { - "type": "integer", - "description": "The time to live of the event." - } - }, - "additionalProperties": false, - "required": [ - "event", - "ttl_seconds" - ], - "title": "LogEventRequest" - }, - "InvokeToolRequest": { + "InvokeToolRequest": { "type": "object", "properties": { "tool_name": { @@ -16321,621 +15598,70 @@ "$ref": "#/components/schemas/AgentConfig", "description": "Configuration settings for the agent" }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp when the agent was created" - } - }, - "additionalProperties": false, - "required": [ - "agent_id", - "agent_config", - "created_at" - ], - "title": "Agent", - "description": "An agent instance with configuration and metadata." - }, - "CreateAgentSessionRequest": { - "type": "object", - "properties": { - "session_name": { - "type": "string", - "description": "The name of the session to create." - } - }, - "additionalProperties": false, - "required": [ - "session_name" - ], - "title": "CreateAgentSessionRequest" - }, - "AgentSessionCreateResponse": { - "type": "object", - "properties": { - "session_id": { - "type": "string", - "description": "Unique identifier for the created session" - } - }, - "additionalProperties": false, - "required": [ - "session_id" - ], - "title": "AgentSessionCreateResponse", - "description": "Response returned when creating a new agent session." - }, - "InferenceStep": { - "type": "object", - "properties": { - "turn_id": { - "type": "string", - "description": "The ID of the turn." - }, - "step_id": { - "type": "string", - "description": "The ID of the step." - }, - "started_at": { - "type": "string", - "format": "date-time", - "description": "The time the step started." - }, - "completed_at": { - "type": "string", - "format": "date-time", - "description": "The time the step completed." - }, - "step_type": { - "type": "string", - "enum": [ - "inference", - "tool_execution", - "shield_call", - "memory_retrieval" - ], - "title": "StepType", - "description": "Type of the step in an agent turn.", - "const": "inference", - "default": "inference" - }, - "model_response": { - "$ref": "#/components/schemas/CompletionMessage", - "description": "The response from the LLM." - } - }, - "additionalProperties": false, - "required": [ - "turn_id", - "step_id", - "step_type", - "model_response" - ], - "title": "InferenceStep", - "description": "An inference step in an agent turn." - }, - "MemoryRetrievalStep": { - "type": "object", - "properties": { - "turn_id": { - "type": "string", - "description": "The ID of the turn." - }, - "step_id": { - "type": "string", - "description": "The ID of the step." - }, - "started_at": { - "type": "string", - "format": "date-time", - "description": "The time the step started." - }, - "completed_at": { - "type": "string", - "format": "date-time", - "description": "The time the step completed." - }, - "step_type": { - "type": "string", - "enum": [ - "inference", - "tool_execution", - "shield_call", - "memory_retrieval" - ], - "title": "StepType", - "description": "Type of the step in an agent turn.", - "const": "memory_retrieval", - "default": "memory_retrieval" - }, - "vector_db_ids": { - "type": "string", - "description": "The IDs of the vector databases to retrieve context from." - }, - "inserted_context": { - "$ref": "#/components/schemas/InterleavedContent", - "description": "The context retrieved from the vector databases." - } - }, - "additionalProperties": false, - "required": [ - "turn_id", - "step_id", - "step_type", - "vector_db_ids", - "inserted_context" - ], - "title": "MemoryRetrievalStep", - "description": "A memory retrieval step in an agent turn." - }, - "Session": { - "type": "object", - "properties": { - "session_id": { - "type": "string", - "description": "Unique identifier for the conversation session" - }, - "session_name": { - "type": "string", - "description": "Human-readable name for the session" - }, - "turns": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Turn" - }, - "description": "List of all turns that have occurred in this session" - }, - "started_at": { - "type": "string", - "format": "date-time", - "description": "Timestamp when the session was created" - } - }, - "additionalProperties": false, - "required": [ - "session_id", - "session_name", - "turns", - "started_at" - ], - "title": "Session", - "description": "A single session of an interaction with an Agentic System." - }, - "ShieldCallStep": { - "type": "object", - "properties": { - "turn_id": { - "type": "string", - "description": "The ID of the turn." - }, - "step_id": { - "type": "string", - "description": "The ID of the step." - }, - "started_at": { - "type": "string", - "format": "date-time", - "description": "The time the step started." - }, - "completed_at": { - "type": "string", - "format": "date-time", - "description": "The time the step completed." - }, - "step_type": { - "type": "string", - "enum": [ - "inference", - "tool_execution", - "shield_call", - "memory_retrieval" - ], - "title": "StepType", - "description": "Type of the step in an agent turn.", - "const": "shield_call", - "default": "shield_call" - }, - "violation": { - "$ref": "#/components/schemas/SafetyViolation", - "description": "The violation from the shield call." - } - }, - "additionalProperties": false, - "required": [ - "turn_id", - "step_id", - "step_type" - ], - "title": "ShieldCallStep", - "description": "A shield call step in an agent turn." - }, - "ToolExecutionStep": { - "type": "object", - "properties": { - "turn_id": { - "type": "string", - "description": "The ID of the turn." - }, - "step_id": { - "type": "string", - "description": "The ID of the step." - }, - "started_at": { - "type": "string", - "format": "date-time", - "description": "The time the step started." - }, - "completed_at": { - "type": "string", - "format": "date-time", - "description": "The time the step completed." - }, - "step_type": { - "type": "string", - "enum": [ - "inference", - "tool_execution", - "shield_call", - "memory_retrieval" - ], - "title": "StepType", - "description": "Type of the step in an agent turn.", - "const": "tool_execution", - "default": "tool_execution" - }, - "tool_calls": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ToolCall" - }, - "description": "The tool calls to execute." - }, - "tool_responses": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ToolResponse" - }, - "description": "The tool responses from the tool calls." - } - }, - "additionalProperties": false, - "required": [ - "turn_id", - "step_id", - "step_type", - "tool_calls", - "tool_responses" - ], - "title": "ToolExecutionStep", - "description": "A tool execution step in an agent turn." - }, - "ToolResponse": { - "type": "object", - "properties": { - "call_id": { - "type": "string", - "description": "Unique identifier for the tool call this response is for" - }, - "tool_name": { - "oneOf": [ - { - "type": "string", - "enum": [ - "brave_search", - "wolfram_alpha", - "photogen", - "code_interpreter" - ], - "title": "BuiltinTool" - }, - { - "type": "string" - } - ], - "description": "Name of the tool that was invoked" - }, - "content": { - "$ref": "#/components/schemas/InterleavedContent", - "description": "The response content from the tool" - }, - "metadata": { - "type": "object", - "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", - "properties": { - "turn_id": { - "type": "string", - "description": "Unique identifier for the turn within a session" - }, - "session_id": { - "type": "string", - "description": "Unique identifier for the conversation session" - }, - "input_messages": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/UserMessage" - }, - { - "$ref": "#/components/schemas/ToolResponseMessage" - } - ] - }, - "description": "List of messages that initiated this turn" - }, - "steps": { - "type": "array", - "items": { - "oneOf": [ - { - "$ref": "#/components/schemas/InferenceStep" - }, - { - "$ref": "#/components/schemas/ToolExecutionStep" - }, - { - "$ref": "#/components/schemas/ShieldCallStep" - }, - { - "$ref": "#/components/schemas/MemoryRetrievalStep" - } - ], - "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": { - "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." - }, - "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." + "created_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp when the agent was created" } }, "additionalProperties": false, "required": [ - "messages" + "agent_id", + "agent_config", + "created_at" ], - "title": "CreateAgentTurnRequest" + "title": "Agent", + "description": "An agent instance with configuration and metadata." }, - "AgentTurnResponseEvent": { + "CreateAgentSessionRequest": { "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" + "session_name": { + "type": "string", + "description": "The name of the session to create." } }, "additionalProperties": false, "required": [ - "payload" + "session_name" ], - "title": "AgentTurnResponseEvent", - "description": "An event in an agent turn response stream." + "title": "CreateAgentSessionRequest" }, - "AgentTurnResponseStepCompletePayload": { + "AgentSessionCreateResponse": { "type": "object", "properties": { - "event_type": { + "session_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" + "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", @@ -16945,65 +15671,134 @@ "shield_call", "memory_retrieval" ], - "description": "Type of step being executed" + "title": "StepType", + "description": "Type of the step in an agent turn.", + "const": "inference", + "default": "inference" + }, + "model_response": { + "$ref": "#/components/schemas/CompletionMessage", + "description": "The response from the LLM." + } + }, + "additionalProperties": false, + "required": [ + "turn_id", + "step_id", + "step_type", + "model_response" + ], + "title": "InferenceStep", + "description": "An inference step in an agent turn." + }, + "MemoryRetrievalStep": { + "type": "object", + "properties": { + "turn_id": { + "type": "string", + "description": "The ID of the turn." }, "step_id": { "type": "string", - "description": "Unique identifier for the step within a turn" + "description": "The ID of the step." }, - "step_details": { - "oneOf": [ - { - "$ref": "#/components/schemas/InferenceStep" - }, - { - "$ref": "#/components/schemas/ToolExecutionStep" - }, - { - "$ref": "#/components/schemas/ShieldCallStep" - }, - { - "$ref": "#/components/schemas/MemoryRetrievalStep" - } + "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" ], - "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" + "title": "StepType", + "description": "Type of the step in an agent turn.", + "const": "memory_retrieval", + "default": "memory_retrieval" + }, + "vector_db_ids": { + "type": "string", + "description": "The IDs of the vector databases to retrieve context from." + }, + "inserted_context": { + "$ref": "#/components/schemas/InterleavedContent", + "description": "The context retrieved from the vector databases." } }, "additionalProperties": false, "required": [ - "event_type", - "step_type", + "turn_id", "step_id", - "step_details" + "step_type", + "vector_db_ids", + "inserted_context" ], - "title": "AgentTurnResponseStepCompletePayload", - "description": "Payload for step completion events in agent turn responses." + "title": "MemoryRetrievalStep", + "description": "A memory retrieval step in an agent turn." }, - "AgentTurnResponseStepProgressPayload": { + "Session": { "type": "object", "properties": { - "event_type": { + "session_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" + "description": "Unique identifier for the conversation session" + }, + "session_name": { + "type": "string", + "description": "Human-readable name for the session" + }, + "turns": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Turn" + }, + "description": "List of all turns that have occurred in this session" + }, + "started_at": { + "type": "string", + "format": "date-time", + "description": "Timestamp when the session was created" + } + }, + "additionalProperties": false, + "required": [ + "session_id", + "session_name", + "turns", + "started_at" + ], + "title": "Session", + "description": "A single session of an interaction with an Agentic System." + }, + "ShieldCallStep": { + "type": "object", + "properties": { + "turn_id": { + "type": "string", + "description": "The ID of the turn." + }, + "step_id": { + "type": "string", + "description": "The ID of the step." + }, + "started_at": { + "type": "string", + "format": "date-time", + "description": "The time the step started." + }, + "completed_at": { + "type": "string", + "format": "date-time", + "description": "The time the step completed." }, "step_type": { "type": "string", @@ -17013,61 +15808,45 @@ "shield_call", "memory_retrieval" ], - "description": "Type of step being executed" - }, - "step_id": { - "type": "string", - "description": "Unique identifier for the step within a turn" + "title": "StepType", + "description": "Type of the step in an agent turn.", + "const": "shield_call", + "default": "shield_call" }, - "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" + "violation": { + "$ref": "#/components/schemas/SafetyViolation", + "description": "The violation from the shield call." } }, "additionalProperties": false, "required": [ - "event_type", - "step_type", + "turn_id", "step_id", - "delta" + "step_type" ], - "title": "AgentTurnResponseStepProgressPayload", - "description": "Payload for step progress events in agent turn responses." + "title": "ShieldCallStep", + "description": "A shield call step in an agent turn." }, - "AgentTurnResponseStepStartPayload": { + "ToolExecutionStep": { "type": "object", "properties": { - "event_type": { + "turn_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" + "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", @@ -17077,11 +15856,65 @@ "shield_call", "memory_retrieval" ], - "description": "Type of step being executed" + "title": "StepType", + "description": "Type of the step in an agent turn.", + "const": "tool_execution", + "default": "tool_execution" }, - "step_id": { + "tool_calls": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ToolCall" + }, + "description": "The tool calls to execute." + }, + "tool_responses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ToolResponse" + }, + "description": "The tool responses from the tool calls." + } + }, + "additionalProperties": false, + "required": [ + "turn_id", + "step_id", + "step_type", + "tool_calls", + "tool_responses" + ], + "title": "ToolExecutionStep", + "description": "A tool execution step in an agent turn." + }, + "ToolResponse": { + "type": "object", + "properties": { + "call_id": { "type": "string", - "description": "Unique identifier for the step within a turn" + "description": "Unique identifier for the tool call this response is for" + }, + "tool_name": { + "oneOf": [ + { + "type": "string", + "enum": [ + "brave_search", + "wolfram_alpha", + "photogen", + "code_interpreter" + ], + "title": "BuiltinTool" + }, + { + "type": "string" + } + ], + "description": "Name of the tool that was invoked" + }, + "content": { + "$ref": "#/components/schemas/InterleavedContent", + "description": "The response content from the tool" }, "metadata": { "type": "object", @@ -17107,233 +15940,295 @@ } ] }, - "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", - "description": "Individual event in the agent turn response stream" + "description": "(Optional) Additional metadata about the tool response" } }, "additionalProperties": false, "required": [ - "event" + "call_id", + "tool_name", + "content" ], - "title": "AgentTurnResponseStreamChunk", - "description": "Streamed agent turn completion response." + "title": "ToolResponse", + "description": "Response from a tool invocation." }, - "AgentTurnResponseTurnAwaitingInputPayload": { + "Turn": { "type": "object", "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" + "description": "Unique identifier for the turn within a session" }, - "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": { + "session_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" + "description": "Unique identifier for the conversation session" + }, + "input_messages": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/UserMessage" + }, + { + "$ref": "#/components/schemas/ToolResponseMessage" + } + ] + }, + "description": "List of messages that initiated this turn" + }, + "steps": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/InferenceStep" + }, + { + "$ref": "#/components/schemas/ToolExecutionStep" + }, + { + "$ref": "#/components/schemas/ShieldCallStep" + }, + { + "$ref": "#/components/schemas/MemoryRetrievalStep" + } + ], + "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": { + "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" }, - "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": { + "started_at": { "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" + "format": "date-time", + "description": "Timestamp when the turn began" }, - "turn_id": { + "completed_at": { "type": "string", - "description": "Unique identifier for the turn within a session" + "format": "date-time", + "description": "(Optional) Timestamp when the turn finished, if completed" } }, "additionalProperties": false, "required": [ - "event_type", - "turn_id" + "turn_id", + "session_id", + "input_messages", + "steps", + "output_message", + "started_at" ], - "title": "AgentTurnResponseTurnStartPayload", - "description": "Payload for turn start events in agent turn responses." + "title": "Turn", + "description": "A single turn in an interaction with an Agentic System." }, - "ImageDelta": { + "CreateAgentTurnRequest": { "type": "object", "properties": { - "type": { - "type": "string", - "const": "image", - "default": "image", - "description": "Discriminator type of the delta. Always \"image\"" + "messages": { + "type": "array", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/UserMessage" + }, + { + "$ref": "#/components/schemas/ToolResponseMessage" + } + ] + }, + "description": "List of messages to start the turn with." }, - "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", - "description": "Discriminator type of the delta. Always \"text\"" + "stream": { + "type": "boolean", + "description": "(Optional) If True, generate an SSE event stream of the response. Defaults to False." }, - "text": { - "type": "string", - "description": "The incremental text content" + "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": [ - "type", - "text" + "messages" ], - "title": "TextDelta", - "description": "A text content delta for streaming responses." + "title": "CreateAgentTurnRequest" }, - "ToolCallDelta": { + "AgentTurnResponseEvent": { "type": "object", "properties": { - "type": { - "type": "string", - "const": "tool_call", - "default": "tool_call", - "description": "Discriminator type of the delta. Always \"tool_call\"" - }, - "tool_call": { + "payload": { "oneOf": [ { - "type": "string" + "$ref": "#/components/schemas/AgentTurnResponseStepStartPayload" }, { - "$ref": "#/components/schemas/ToolCall" + "$ref": "#/components/schemas/AgentTurnResponseStepProgressPayload" + }, + { + "$ref": "#/components/schemas/AgentTurnResponseStepCompletePayload" + }, + { + "$ref": "#/components/schemas/AgentTurnResponseTurnStartPayload" + }, + { + "$ref": "#/components/schemas/AgentTurnResponseTurnCompletePayload" + }, + { + "$ref": "#/components/schemas/AgentTurnResponseTurnAwaitingInputPayload" } ], - "description": "Either an in-progress tool call string or the final parsed tool call" - }, - "parse_status": { - "type": "string", - "enum": [ - "started", - "in_progress", - "failed", - "succeeded" - ], - "description": "Current parsing status of the tool call" - } - }, - "additionalProperties": false, - "required": [ - "type", - "tool_call", - "parse_status" - ], - "title": "ToolCallDelta", - "description": "A tool call content delta for streaming responses." - }, - "ResumeAgentTurnRequest": { - "type": "object", - "properties": { - "tool_responses": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ToolResponse" - }, - "description": "The tool call responses to resume the turn with." - }, - "stream": { - "type": "boolean", - "description": "Whether to stream the response." + "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": [ - "tool_responses" + "payload" ], - "title": "ResumeAgentTurnRequest" + "title": "AgentTurnResponseEvent", + "description": "An event in an agent turn response stream." }, - "AgentStepResponse": { + "AgentTurnResponseStepCompletePayload": { "type": "object", "properties": { - "step": { + "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" @@ -17357,136 +16252,113 @@ "memory_retrieval": "#/components/schemas/MemoryRetrievalStep" } }, - "description": "The complete step data and execution details" + "description": "Complete details of the executed step" } }, "additionalProperties": false, "required": [ - "step" + "event_type", + "step_type", + "step_id", + "step_details" ], - "title": "AgentStepResponse", - "description": "Response containing details of a specific agent step." + "title": "AgentTurnResponseStepCompletePayload", + "description": "Payload for step completion events in agent turn responses." }, - "Benchmark": { + "AgentTurnResponseStepProgressPayload": { "type": "object", "properties": { - "identifier": { - "type": "string" - }, - "provider_resource_id": { - "type": "string" - }, - "provider_id": { - "type": "string" - }, - "type": { + "event_type": { "type": "string", "enum": [ - "model", - "shield", - "vector_db", - "dataset", - "scoring_function", - "benchmark", - "tool", - "tool_group", - "prompt" + "step_start", + "step_complete", + "step_progress", + "turn_start", + "turn_complete", + "turn_awaiting_input" ], - "const": "benchmark", - "default": "benchmark", - "description": "The resource type, always benchmark" + "const": "step_progress", + "default": "step_progress", + "description": "Type of event being reported" }, - "dataset_id": { + "step_type": { "type": "string", - "description": "Identifier of the dataset to use for the benchmark evaluation" + "enum": [ + "inference", + "tool_execution", + "shield_call", + "memory_retrieval" + ], + "description": "Type of step being executed" }, - "scoring_functions": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of scoring function identifiers to apply during evaluation" + "step_id": { + "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" - } - ] + "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": "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" - } + "description": "Incremental content changes during step execution" } }, "additionalProperties": false, "required": [ - "data" + "event_type", + "step_type", + "step_id", + "delta" ], - "title": "ListBenchmarksResponse" + "title": "AgentTurnResponseStepProgressPayload", + "description": "Payload for step progress events in agent turn responses." }, - "RegisterBenchmarkRequest": { + "AgentTurnResponseStepStartPayload": { "type": "object", "properties": { - "benchmark_id": { - "type": "string", - "description": "The ID of the benchmark to register." - }, - "dataset_id": { + "event_type": { "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." + "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" }, - "provider_benchmark_id": { + "step_type": { "type": "string", - "description": "The ID of the provider benchmark to use for the benchmark." + "enum": [ + "inference", + "tool_execution", + "shield_call", + "memory_retrieval" + ], + "description": "Type of step being executed" }, - "provider_id": { + "step_id": { "type": "string", - "description": "The ID of the provider to use for the benchmark." + "description": "Unique identifier for the step within a turn" }, "metadata": { "type": "object", @@ -17499,493 +16371,401 @@ "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." + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + }, + "description": "(Optional) Additional metadata for the step" } }, "additionalProperties": false, "required": [ - "type", - "config" + "event_type", + "step_type", + "step_id" ], - "title": "AgentCandidate", - "description": "An agent candidate for evaluation." + "title": "AgentTurnResponseStepStartPayload", + "description": "Payload for step start events in agent turn responses." }, - "BenchmarkConfig": { + "AgentTurnResponseStreamChunk": { "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" + "event": { + "$ref": "#/components/schemas/AgentTurnResponseEvent", + "description": "Individual event in the agent turn response stream" } }, "additionalProperties": false, "required": [ - "eval_candidate", - "scoring_params" + "event" ], - "title": "BenchmarkConfig", - "description": "A benchmark configuration for evaluation." + "title": "AgentTurnResponseStreamChunk", + "description": "Streamed agent turn completion response." }, - "ModelCandidate": { + "AgentTurnResponseTurnAwaitingInputPayload": { "type": "object", "properties": { - "type": { - "type": "string", - "const": "model", - "default": "model" - }, - "model": { + "event_type": { "type": "string", - "description": "The model ID to evaluate." - }, - "sampling_params": { - "$ref": "#/components/schemas/SamplingParams", - "description": "The sampling parameters for the model." + "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" }, - "system_message": { - "$ref": "#/components/schemas/SystemMessage", - "description": "(Optional) The system message providing instructions or context to the model." + "turn": { + "$ref": "#/components/schemas/Turn", + "description": "Turn data when waiting for external tool responses" } }, "additionalProperties": false, "required": [ - "type", - "model", - "sampling_params" + "event_type", + "turn" ], - "title": "ModelCandidate", - "description": "A model candidate for evaluation." + "title": "AgentTurnResponseTurnAwaitingInputPayload", + "description": "Payload for turn awaiting input events in agent turn responses." }, - "EvaluateRowsRequest": { + "AgentTurnResponseTurnCompletePayload": { "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." + "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" }, - "benchmark_config": { - "$ref": "#/components/schemas/BenchmarkConfig", - "description": "The configuration for the benchmark." + "turn": { + "$ref": "#/components/schemas/Turn", + "description": "Complete turn data including all steps and results" } }, "additionalProperties": false, "required": [ - "input_rows", - "scoring_functions", - "benchmark_config" + "event_type", + "turn" ], - "title": "EvaluateRowsRequest" + "title": "AgentTurnResponseTurnCompletePayload", + "description": "Payload for turn completion events in agent turn responses." }, - "EvaluateResponse": { + "AgentTurnResponseTurnStartPayload": { "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." + "event_type": { + "type": "string", + "enum": [ + "step_start", + "step_complete", + "step_progress", + "turn_start", + "turn_complete", + "turn_awaiting_input" + ], + "const": "turn_start", + "default": "turn_start", + "description": "Type of event being reported" }, - "scores": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/ScoringResult" - }, - "description": "The scores from the evaluation." + "turn_id": { + "type": "string", + "description": "Unique identifier for the turn within a session" } }, "additionalProperties": false, "required": [ - "generations", - "scores" + "event_type", + "turn_id" ], - "title": "EvaluateResponse", - "description": "The response from an evaluation." + "title": "AgentTurnResponseTurnStartPayload", + "description": "Payload for turn start events in agent turn responses." }, - "RunEvalRequest": { + "ImageDelta": { "type": "object", "properties": { - "benchmark_config": { - "$ref": "#/components/schemas/BenchmarkConfig", - "description": "The configuration for the benchmark." + "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": [ - "benchmark_config" + "type", + "image" ], - "title": "RunEvalRequest" + "title": "ImageDelta", + "description": "An image content delta for streaming responses." }, - "Job": { + "TextDelta": { "type": "object", "properties": { - "job_id": { + "type": { "type": "string", - "description": "Unique identifier for the job" + "const": "text", + "default": "text", + "description": "Discriminator type of the delta. Always \"text\"" }, - "status": { + "text": { "type": "string", - "enum": [ - "completed", - "in_progress", - "failed", - "scheduled", - "cancelled" - ], - "description": "Current execution status of the job" + "description": "The incremental text content" } }, "additionalProperties": false, "required": [ - "job_id", - "status" + "type", + "text" ], - "title": "Job", - "description": "A job execution instance with status tracking." + "title": "TextDelta", + "description": "A text content delta for streaming responses." }, - "RerankRequest": { + "ToolCallDelta": { "type": "object", "properties": { - "model": { + "type": { "type": "string", - "description": "The identifier of the reranking model to use." + "const": "tool_call", + "default": "tool_call", + "description": "Discriminator type of the delta. Always \"tool_call\"" }, - "query": { + "tool_call": { "oneOf": [ { "type": "string" }, { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" - }, - { - "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" + "$ref": "#/components/schemas/ToolCall" } ], - "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." + "description": "Either an in-progress tool call string or the final parsed tool call" }, - "max_num_results": { - "type": "integer", - "description": "(Optional) Maximum number of results to return. Default: returns all." + "parse_status": { + "type": "string", + "enum": [ + "started", + "in_progress", + "failed", + "succeeded" + ], + "description": "Current parsing status of the tool call" } }, "additionalProperties": false, "required": [ - "model", - "query", - "items" + "type", + "tool_call", + "parse_status" ], - "title": "RerankRequest" + "title": "ToolCallDelta", + "description": "A tool call content delta for streaming responses." }, - "RerankData": { + "ResumeAgentTurnRequest": { "type": "object", "properties": { - "index": { - "type": "integer", - "description": "The original index of the document in the input list" + "tool_responses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ToolResponse" + }, + "description": "The tool call responses to resume the turn with." }, - "relevance_score": { - "type": "number", - "description": "The relevance score from the model output. Values are inverted when applicable so that higher scores indicate greater relevance." + "stream": { + "type": "boolean", + "description": "Whether to stream the response." } }, "additionalProperties": false, "required": [ - "index", - "relevance_score" + "tool_responses" ], - "title": "RerankData", - "description": "A single rerank result from a reranking response." + "title": "ResumeAgentTurnRequest" }, - "RerankResponse": { + "AgentStepResponse": { "type": "object", "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/RerankData" + "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": "List of rerank result objects, sorted by relevance score (descending)" + "description": "The complete step data and execution details" } }, "additionalProperties": false, "required": [ - "data" + "step" ], - "title": "RerankResponse", - "description": "Response from a reranking request." + "title": "AgentStepResponse", + "description": "Response containing details of a specific agent step." }, - "Checkpoint": { + "Benchmark": { "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" + "type": "string" }, - "epoch": { - "type": "integer", - "description": "Training epoch when the checkpoint was saved" + "provider_resource_id": { + "type": "string" }, - "post_training_job_id": { - "type": "string", - "description": "Identifier of the training job that created this checkpoint" + "provider_id": { + "type": "string" }, - "path": { + "type": { "type": "string", - "description": "File system path where the checkpoint is stored" + "enum": [ + "model", + "shield", + "vector_db", + "dataset", + "scoring_function", + "benchmark", + "tool", + "tool_group", + "prompt" + ], + "const": "benchmark", + "default": "benchmark", + "description": "The resource type, always benchmark" }, - "training_metrics": { - "$ref": "#/components/schemas/PostTrainingMetric", - "description": "(Optional) Training metrics associated with this checkpoint" - } - }, - "additionalProperties": false, - "required": [ - "identifier", - "created_at", - "epoch", - "post_training_job_id", - "path" - ], - "title": "Checkpoint", - "description": "Checkpoint created during training runs." - }, - "PostTrainingJobArtifactsResponse": { - "type": "object", - "properties": { - "job_uuid": { + "dataset_id": { "type": "string", - "description": "Unique identifier for the training job" + "description": "Identifier of the dataset to use for the benchmark evaluation" }, - "checkpoints": { + "scoring_functions": { "type": "array", "items": { - "$ref": "#/components/schemas/Checkpoint" + "type": "string" }, - "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" + "description": "List of scoring function identifiers to apply during evaluation" }, - "perplexity": { - "type": "number", - "description": "Perplexity metric indicating model confidence" + "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": [ - "epoch", - "train_loss", - "validation_loss", - "perplexity" + "identifier", + "provider_id", + "type", + "dataset_id", + "scoring_functions", + "metadata" ], - "title": "PostTrainingMetric", - "description": "Training metrics captured during post-training jobs." + "title": "Benchmark", + "description": "A benchmark resource for evaluating model performance." }, - "CancelTrainingJobRequest": { + "ListBenchmarksResponse": { "type": "object", "properties": { - "job_uuid": { - "type": "string", - "description": "The UUID of the job to cancel." + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Benchmark" + } } }, "additionalProperties": false, "required": [ - "job_uuid" + "data" ], - "title": "CancelTrainingJobRequest" + "title": "ListBenchmarksResponse" }, - "PostTrainingJobStatusResponse": { + "RegisterBenchmarkRequest": { "type": "object", "properties": { - "job_uuid": { + "benchmark_id": { "type": "string", - "description": "Unique identifier for the training job" + "description": "The ID of the benchmark to register." }, - "status": { + "dataset_id": { "type": "string", - "enum": [ - "completed", - "in_progress", - "failed", - "scheduled", - "cancelled" - ], - "description": "Current status of the training job" + "description": "The ID of the dataset to use for the benchmark." }, - "scheduled_at": { - "type": "string", - "format": "date-time", - "description": "(Optional) Timestamp when the job was scheduled" + "scoring_functions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The scoring functions to use for the benchmark." }, - "started_at": { + "provider_benchmark_id": { "type": "string", - "format": "date-time", - "description": "(Optional) Timestamp when the job execution began" + "description": "The ID of the provider benchmark to use for the benchmark." }, - "completed_at": { + "provider_id": { "type": "string", - "format": "date-time", - "description": "(Optional) Timestamp when the job finished, if completed" + "description": "The ID of the provider to use for the benchmark." }, - "resources_allocated": { + "metadata": { "type": "object", "additionalProperties": { "oneOf": [ @@ -18009,485 +16789,480 @@ } ] }, - "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" + "description": "The metadata to use for the benchmark." } }, "additionalProperties": false, "required": [ - "job_uuid", - "status", - "checkpoints" + "benchmark_id", + "dataset_id", + "scoring_functions" ], - "title": "PostTrainingJobStatusResponse", - "description": "Status of a finetuning job." + "title": "RegisterBenchmarkRequest" }, - "ListPostTrainingJobsResponse": { + "AgentCandidate": { "type": "object", "properties": { - "data": { - "type": "array", - "items": { - "type": "object", - "properties": { - "job_uuid": { - "type": "string" - } - }, - "additionalProperties": false, - "required": [ - "job_uuid" - ], - "title": "PostTrainingJob" - } + "type": { + "type": "string", + "const": "agent", + "default": "agent" + }, + "config": { + "$ref": "#/components/schemas/AgentConfig", + "description": "The configuration for the agent candidate." } }, "additionalProperties": false, "required": [ - "data" + "type", + "config" ], - "title": "ListPostTrainingJobsResponse" + "title": "AgentCandidate", + "description": "An agent candidate for evaluation." }, - "DPOAlignmentConfig": { + "BenchmarkConfig": { "type": "object", "properties": { - "beta": { - "type": "number", - "description": "Temperature parameter for the DPO loss" + "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." }, - "loss_type": { - "$ref": "#/components/schemas/DPOLossType", - "default": "sigmoid", - "description": "The type of loss function to use for DPO" + "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": [ - "beta", - "loss_type" - ], - "title": "DPOAlignmentConfig", - "description": "Configuration for Direct Preference Optimization (DPO) alignment." - }, - "DPOLossType": { - "type": "string", - "enum": [ - "sigmoid", - "hinge", - "ipo", - "kto_pair" + "eval_candidate", + "scoring_params" ], - "title": "DPOLossType" + "title": "BenchmarkConfig", + "description": "A benchmark configuration for evaluation." }, - "DataConfig": { + "ModelCandidate": { "type": "object", "properties": { - "dataset_id": { + "type": { "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)" + "const": "model", + "default": "model" }, - "validation_dataset_id": { + "model": { "type": "string", - "description": "(Optional) Unique identifier for the validation dataset" + "description": "The model ID to evaluate." }, - "packed": { - "type": "boolean", - "default": false, - "description": "(Optional) Whether to pack multiple samples into a single sequence for efficiency" + "sampling_params": { + "$ref": "#/components/schemas/SamplingParams", + "description": "The sampling parameters for the model." }, - "train_on_input": { - "type": "boolean", - "default": false, - "description": "(Optional) Whether to compute loss on input tokens as well as output tokens" + "system_message": { + "$ref": "#/components/schemas/SystemMessage", + "description": "(Optional) The system message providing instructions or context to the model." } }, "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" + "type", + "model", + "sampling_params" ], - "title": "DatasetFormat", - "description": "Format of the training dataset." + "title": "ModelCandidate", + "description": "A model candidate for evaluation." }, - "EfficiencyConfig": { + "EvaluateRowsRequest": { "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" + "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." }, - "memory_efficient_fsdp_wrap": { - "type": "boolean", - "default": false, - "description": "(Optional) Whether to use memory-efficient FSDP wrapping" + "scoring_functions": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The scoring functions to use for the evaluation." }, - "fsdp_cpu_offload": { - "type": "boolean", - "default": false, - "description": "(Optional) Whether to offload FSDP parameters to CPU" + "benchmark_config": { + "$ref": "#/components/schemas/BenchmarkConfig", + "description": "The configuration for the benchmark." } }, "additionalProperties": false, - "title": "EfficiencyConfig", - "description": "Configuration for memory and compute efficiency optimizations." + "required": [ + "input_rows", + "scoring_functions", + "benchmark_config" + ], + "title": "EvaluateRowsRequest" }, - "OptimizerConfig": { + "EvaluateResponse": { "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" + "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." }, - "num_warmup_steps": { - "type": "integer", - "description": "Number of steps for learning rate warmup" + "scores": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/ScoringResult" + }, + "description": "The scores from the evaluation." } }, "additionalProperties": false, "required": [ - "optimizer_type", - "lr", - "weight_decay", - "num_warmup_steps" + "generations", + "scores" ], - "title": "OptimizerConfig", - "description": "Configuration parameters for the optimization algorithm." + "title": "EvaluateResponse", + "description": "The response from an evaluation." }, - "OptimizerType": { - "type": "string", - "enum": [ - "adam", - "adamw", - "sgd" + "RunEvalRequest": { + "type": "object", + "properties": { + "benchmark_config": { + "$ref": "#/components/schemas/BenchmarkConfig", + "description": "The configuration for the benchmark." + } + }, + "additionalProperties": false, + "required": [ + "benchmark_config" ], - "title": "OptimizerType", - "description": "Available optimizer algorithms for training." + "title": "RunEvalRequest" }, - "TrainingConfig": { + "Job": { "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" + "job_id": { + "type": "string", + "description": "Unique identifier for the job" }, - "dtype": { + "status": { "type": "string", - "default": "bf16", - "description": "(Optional) Data type for model parameters (bf16, fp16, fp32)" + "enum": [ + "completed", + "in_progress", + "failed", + "scheduled", + "cancelled" + ], + "description": "Current execution status of the job" } }, "additionalProperties": false, "required": [ - "n_epochs", - "max_steps_per_epoch", - "gradient_accumulation_steps" + "job_id", + "status" ], - "title": "TrainingConfig", - "description": "Comprehensive configuration for the training process." + "title": "Job", + "description": "A job execution instance with status tracking." }, - "PreferenceOptimizeRequest": { + "RerankRequest": { "type": "object", "properties": { - "job_uuid": { - "type": "string", - "description": "The UUID of the job to create." - }, - "finetuned_model": { + "model": { "type": "string", - "description": "The model to fine-tune." - }, - "algorithm_config": { - "$ref": "#/components/schemas/DPOAlignmentConfig", - "description": "The algorithm configuration." + "description": "The identifier of the reranking model to use." }, - "training_config": { - "$ref": "#/components/schemas/TrainingConfig", - "description": "The training configuration." + "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." }, - "hyperparam_search_config": { - "type": "object", - "additionalProperties": { + "items": { + "type": "array", + "items": { "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, { "type": "string" }, { - "type": "array" + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartTextParam" }, { - "type": "object" + "$ref": "#/components/schemas/OpenAIChatCompletionContentPartImageParam" } ] }, - "description": "The hyperparam search configuration." + "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." }, - "logger_config": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "The logger configuration." + "max_num_results": { + "type": "integer", + "description": "(Optional) Maximum number of results to return. Default: returns all." + } + }, + "additionalProperties": false, + "required": [ + "model", + "query", + "items" + ], + "title": "RerankRequest" + }, + "RerankData": { + "type": "object", + "properties": { + "index": { + "type": "integer", + "description": "The original index of the document in the input list" + }, + "relevance_score": { + "type": "number", + "description": "The relevance score from the model output. Values are inverted when applicable so that higher scores indicate greater relevance." } }, "additionalProperties": false, "required": [ - "job_uuid", - "finetuned_model", - "algorithm_config", - "training_config", - "hyperparam_search_config", - "logger_config" + "index", + "relevance_score" ], - "title": "PreferenceOptimizeRequest" + "title": "RerankData", + "description": "A single rerank result from a reranking response." }, - "PostTrainingJob": { + "RerankResponse": { "type": "object", "properties": { - "job_uuid": { - "type": "string" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/RerankData" + }, + "description": "List of rerank result objects, sorted by relevance score (descending)" } }, "additionalProperties": false, "required": [ - "job_uuid" + "data" ], - "title": "PostTrainingJob" + "title": "RerankResponse", + "description": "Response from a reranking request." }, - "AlgorithmConfig": { - "oneOf": [ - { - "$ref": "#/components/schemas/LoraFinetuningConfig" + "Checkpoint": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "Unique identifier for the checkpoint" }, - { - "$ref": "#/components/schemas/QATFinetuningConfig" + "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" ], - "discriminator": { - "propertyName": "type", - "mapping": { - "LoRA": "#/components/schemas/LoraFinetuningConfig", - "QAT": "#/components/schemas/QATFinetuningConfig" - } - } + "title": "Checkpoint", + "description": "Checkpoint created during training runs." }, - "LoraFinetuningConfig": { + "PostTrainingJobArtifactsResponse": { "type": "object", "properties": { - "type": { + "job_uuid": { "type": "string", - "const": "LoRA", - "default": "LoRA", - "description": "Algorithm type identifier, always \"LoRA\"" + "description": "Unique identifier for the training job" }, - "lora_attn_modules": { + "checkpoints": { "type": "array", "items": { - "type": "string" + "$ref": "#/components/schemas/Checkpoint" }, - "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": { + "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": "Rank of the LoRA adaptation (lower rank = fewer parameters)" + "description": "Training epoch number" }, - "alpha": { - "type": "integer", - "description": "LoRA scaling parameter that controls adaptation strength" + "train_loss": { + "type": "number", + "description": "Loss value on the training dataset" }, - "use_dora": { - "type": "boolean", - "default": false, - "description": "(Optional) Whether to use DoRA (Weight-Decomposed Low-Rank Adaptation)" + "validation_loss": { + "type": "number", + "description": "Loss value on the validation dataset" }, - "quantize_base": { - "type": "boolean", - "default": false, - "description": "(Optional) Whether to quantize the base model weights" + "perplexity": { + "type": "number", + "description": "Perplexity metric indicating model confidence" } }, "additionalProperties": false, "required": [ - "type", - "lora_attn_modules", - "apply_lora_to_mlp", - "apply_lora_to_output", - "rank", - "alpha" + "epoch", + "train_loss", + "validation_loss", + "perplexity" ], - "title": "LoraFinetuningConfig", - "description": "Configuration for Low-Rank Adaptation (LoRA) fine-tuning." + "title": "PostTrainingMetric", + "description": "Training metrics captured during post-training jobs." }, - "QATFinetuningConfig": { + "CancelTrainingJobRequest": { "type": "object", "properties": { - "type": { - "type": "string", - "const": "QAT", - "default": "QAT", - "description": "Algorithm type identifier, always \"QAT\"" - }, - "quantizer_name": { + "job_uuid": { "type": "string", - "description": "Name of the quantization algorithm to use" - }, - "group_size": { - "type": "integer", - "description": "Size of groups for grouped quantization" + "description": "The UUID of the job to cancel." } }, "additionalProperties": false, "required": [ - "type", - "quantizer_name", - "group_size" + "job_uuid" ], - "title": "QATFinetuningConfig", - "description": "Configuration for Quantization-Aware Training (QAT) fine-tuning." + "title": "CancelTrainingJobRequest" }, - "SupervisedFineTuneRequest": { + "PostTrainingJobStatusResponse": { "type": "object", "properties": { "job_uuid": { "type": "string", - "description": "The UUID of the job to create." + "description": "Unique identifier for the training job" }, - "training_config": { - "$ref": "#/components/schemas/TrainingConfig", - "description": "The training configuration." + "status": { + "type": "string", + "enum": [ + "completed", + "in_progress", + "failed", + "scheduled", + "cancelled" + ], + "description": "Current status of the training job" }, - "hyperparam_search_config": { - "type": "object", - "additionalProperties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ] - }, - "description": "The hyperparam search configuration." + "scheduled_at": { + "type": "string", + "format": "date-time", + "description": "(Optional) Timestamp when the job was scheduled" }, - "logger_config": { + "started_at": { + "type": "string", + "format": "date-time", + "description": "(Optional) Timestamp when the job execution began" + }, + "completed_at": { + "type": "string", + "format": "date-time", + "description": "(Optional) Timestamp when the job finished, if completed" + }, + "resources_allocated": { "type": "object", "additionalProperties": { "oneOf": [ @@ -18504,311 +17279,305 @@ "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." + "type": "array" + }, + { + "type": "object" + } + ] + }, + "description": "(Optional) Information about computational resources allocated to the job" }, - "algorithm_config": { - "$ref": "#/components/schemas/AlgorithmConfig", - "description": "The algorithm configuration." + "checkpoints": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Checkpoint" + }, + "description": "List of model checkpoints created during training" } }, "additionalProperties": false, "required": [ "job_uuid", - "training_config", - "hyperparam_search_config", - "logger_config" + "status", + "checkpoints" ], - "title": "SupervisedFineTuneRequest" + "title": "PostTrainingJobStatusResponse", + "description": "Status of a finetuning job." }, - "QueryMetricsRequest": { + "ListPostTrainingJobsResponse": { "type": "object", "properties": { - "start_time": { - "type": "integer", - "description": "The start time of the metric to query." - }, - "end_time": { - "type": "integer", - "description": "The end time of the metric to query." - }, - "granularity": { - "type": "string", - "description": "The granularity of the metric to query." - }, - "query_type": { - "type": "string", - "enum": [ - "range", - "instant" - ], - "description": "The type of query to perform." - }, - "label_matchers": { + "data": { "type": "array", "items": { "type": "object", "properties": { - "name": { - "type": "string", - "description": "The name of the label to match" - }, - "value": { - "type": "string", - "description": "The value to match against" - }, - "operator": { - "type": "string", - "enum": [ - "=", - "!=", - "=~", - "!~" - ], - "description": "The comparison operator to use for matching", - "default": "=" + "job_uuid": { + "type": "string" } }, "additionalProperties": false, "required": [ - "name", - "value", - "operator" + "job_uuid" ], - "title": "MetricLabelMatcher", - "description": "A matcher for filtering metrics by label values." - }, - "description": "The label matchers to apply to the metric." + "title": "PostTrainingJob" + } } }, "additionalProperties": false, "required": [ - "start_time", - "query_type" + "data" ], - "title": "QueryMetricsRequest" + "title": "ListPostTrainingJobsResponse" }, - "MetricDataPoint": { + "DPOAlignmentConfig": { "type": "object", "properties": { - "timestamp": { - "type": "integer", - "description": "Unix timestamp when the metric value was recorded" - }, - "value": { + "beta": { "type": "number", - "description": "The numeric value of the metric at this timestamp" + "description": "Temperature parameter for the DPO loss" }, - "unit": { - "type": "string" + "loss_type": { + "$ref": "#/components/schemas/DPOLossType", + "default": "sigmoid", + "description": "The type of loss function to use for DPO" } }, "additionalProperties": false, "required": [ - "timestamp", - "value", - "unit" + "beta", + "loss_type" ], - "title": "MetricDataPoint", - "description": "A single data point in a metric time series." + "title": "DPOAlignmentConfig", + "description": "Configuration for Direct Preference Optimization (DPO) alignment." }, - "MetricLabel": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the label" - }, - "value": { - "type": "string", - "description": "The value of the label" - } - }, - "additionalProperties": false, - "required": [ - "name", - "value" + "DPOLossType": { + "type": "string", + "enum": [ + "sigmoid", + "hinge", + "ipo", + "kto_pair" ], - "title": "MetricLabel", - "description": "A label associated with a metric." + "title": "DPOLossType" }, - "MetricSeries": { + "DataConfig": { "type": "object", "properties": { - "metric": { + "dataset_id": { "type": "string", - "description": "The name of the metric" + "description": "Unique identifier for the training dataset" }, - "labels": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MetricLabel" - }, - "description": "List of labels associated with this metric series" + "batch_size": { + "type": "integer", + "description": "Number of samples per training batch" }, - "values": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MetricDataPoint" - }, - "description": "List of data points in chronological order" + "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": [ - "metric", - "labels", - "values" + "dataset_id", + "batch_size", + "shuffle", + "data_format" + ], + "title": "DataConfig", + "description": "Configuration for training data and data loading." + }, + "DatasetFormat": { + "type": "string", + "enum": [ + "instruct", + "dialog" ], - "title": "MetricSeries", - "description": "A time series of metric data points." + "title": "DatasetFormat", + "description": "Format of the training dataset." }, - "QueryMetricsResponse": { + "EfficiencyConfig": { "type": "object", "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/MetricSeries" - }, - "description": "List of metric series matching the query criteria" + "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, - "required": [ - "data" - ], - "title": "QueryMetricsResponse", - "description": "Response containing metric time series data." + "title": "EfficiencyConfig", + "description": "Configuration for memory and compute efficiency optimizations." }, - "QueryCondition": { + "OptimizerConfig": { "type": "object", "properties": { - "key": { - "type": "string", - "description": "The attribute key to filter on" + "optimizer_type": { + "$ref": "#/components/schemas/OptimizerType", + "description": "Type of optimizer to use (adam, adamw, or sgd)" }, - "op": { - "$ref": "#/components/schemas/QueryConditionOp", - "description": "The comparison operator to apply" + "lr": { + "type": "number", + "description": "Learning rate for the optimizer" }, - "value": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "boolean" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "type": "array" - }, - { - "type": "object" - } - ], - "description": "The value to compare against" + "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": [ - "key", - "op", - "value" + "optimizer_type", + "lr", + "weight_decay", + "num_warmup_steps" ], - "title": "QueryCondition", - "description": "A condition for filtering query results." + "title": "OptimizerConfig", + "description": "Configuration parameters for the optimization algorithm." }, - "QueryConditionOp": { + "OptimizerType": { "type": "string", "enum": [ - "eq", - "ne", - "gt", - "lt" + "adam", + "adamw", + "sgd" ], - "title": "QueryConditionOp", - "description": "Comparison operators for query conditions." + "title": "OptimizerType", + "description": "Available optimizer algorithms for training." }, - "QuerySpansRequest": { + "TrainingConfig": { "type": "object", "properties": { - "attribute_filters": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QueryCondition" - }, - "description": "The attribute filters to apply to the spans." + "n_epochs": { + "type": "integer", + "description": "Number of training epochs to run" }, - "attributes_to_return": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The attributes to return in the spans." + "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_depth": { + "max_validation_steps": { "type": "integer", - "description": "The maximum depth of the tree." + "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": [ - "attribute_filters", - "attributes_to_return" + "n_epochs", + "max_steps_per_epoch", + "gradient_accumulation_steps" ], - "title": "QuerySpansRequest" + "title": "TrainingConfig", + "description": "Comprehensive configuration for the training process." }, - "Span": { + "PreferenceOptimizeRequest": { "type": "object", "properties": { - "span_id": { - "type": "string", - "description": "Unique identifier for the span" - }, - "trace_id": { + "job_uuid": { "type": "string", - "description": "Unique identifier for the trace this span belongs to" + "description": "The UUID of the job to create." }, - "parent_span_id": { + "finetuned_model": { "type": "string", - "description": "(Optional) Unique identifier for the parent span, if this is a child span" + "description": "The model to fine-tune." }, - "name": { - "type": "string", - "description": "Human-readable name describing the operation this span represents" + "algorithm_config": { + "$ref": "#/components/schemas/DPOAlignmentConfig", + "description": "The algorithm configuration." }, - "start_time": { - "type": "string", - "format": "date-time", - "description": "Timestamp when the operation began" + "training_config": { + "$ref": "#/components/schemas/TrainingConfig", + "description": "The training configuration." }, - "end_time": { - "type": "string", - "format": "date-time", - "description": "(Optional) Timestamp when the operation finished, if completed" + "hyperparam_search_config": { + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] + }, + "description": "The hyperparam search configuration." }, - "attributes": { + "logger_config": { "type": "object", "additionalProperties": { "oneOf": [ @@ -18832,119 +17601,144 @@ } ] }, - "description": "(Optional) Key-value pairs containing additional metadata about the span" + "description": "The logger configuration." } }, "additionalProperties": false, "required": [ - "span_id", - "trace_id", - "name", - "start_time" + "job_uuid", + "finetuned_model", + "algorithm_config", + "training_config", + "hyperparam_search_config", + "logger_config" ], - "title": "Span", - "description": "A span representing a single operation within a trace." + "title": "PreferenceOptimizeRequest" }, - "QuerySpansResponse": { + "PostTrainingJob": { "type": "object", "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Span" - }, - "description": "List of spans matching the query criteria" + "job_uuid": { + "type": "string" } }, "additionalProperties": false, "required": [ - "data" + "job_uuid" + ], + "title": "PostTrainingJob" + }, + "AlgorithmConfig": { + "oneOf": [ + { + "$ref": "#/components/schemas/LoraFinetuningConfig" + }, + { + "$ref": "#/components/schemas/QATFinetuningConfig" + } ], - "title": "QuerySpansResponse", - "description": "Response containing a list of spans." + "discriminator": { + "propertyName": "type", + "mapping": { + "LoRA": "#/components/schemas/LoraFinetuningConfig", + "QAT": "#/components/schemas/QATFinetuningConfig" + } + } }, - "SaveSpansToDatasetRequest": { + "LoraFinetuningConfig": { "type": "object", "properties": { - "attribute_filters": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QueryCondition" - }, - "description": "The attribute filters to apply to the spans." + "type": { + "type": "string", + "const": "LoRA", + "default": "LoRA", + "description": "Algorithm type identifier, always \"LoRA\"" }, - "attributes_to_save": { + "lora_attn_modules": { "type": "array", "items": { "type": "string" }, - "description": "The attributes to save to the dataset." + "description": "List of attention module names to apply LoRA to" }, - "dataset_id": { - "type": "string", - "description": "The ID of the dataset to save the spans 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" }, - "max_depth": { + "rank": { + "type": "integer", + "description": "Rank of the LoRA adaptation (lower rank = fewer parameters)" + }, + "alpha": { "type": "integer", - "description": "The maximum depth of the tree." + "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": [ - "attribute_filters", - "attributes_to_save", - "dataset_id" + "type", + "lora_attn_modules", + "apply_lora_to_mlp", + "apply_lora_to_output", + "rank", + "alpha" ], - "title": "SaveSpansToDatasetRequest" + "title": "LoraFinetuningConfig", + "description": "Configuration for Low-Rank Adaptation (LoRA) fine-tuning." }, - "GetSpanTreeRequest": { + "QATFinetuningConfig": { "type": "object", "properties": { - "attributes_to_return": { - "type": "array", - "items": { - "type": "string" - }, - "description": "The attributes to return in the tree." + "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" }, - "max_depth": { + "group_size": { "type": "integer", - "description": "The maximum depth of the tree." + "description": "Size of groups for grouped quantization" } }, "additionalProperties": false, - "title": "GetSpanTreeRequest" + "required": [ + "type", + "quantizer_name", + "group_size" + ], + "title": "QATFinetuningConfig", + "description": "Configuration for Quantization-Aware Training (QAT) fine-tuning." }, - "SpanWithStatus": { + "SupervisedFineTuneRequest": { "type": "object", "properties": { - "span_id": { - "type": "string", - "description": "Unique identifier for the span" - }, - "trace_id": { - "type": "string", - "description": "Unique identifier for the trace this span belongs to" - }, - "parent_span_id": { - "type": "string", - "description": "(Optional) Unique identifier for the parent span, if this is a child span" - }, - "name": { - "type": "string", - "description": "Human-readable name describing the operation this span represents" - }, - "start_time": { + "job_uuid": { "type": "string", - "format": "date-time", - "description": "Timestamp when the operation began" + "description": "The UUID of the job to create." }, - "end_time": { - "type": "string", - "format": "date-time", - "description": "(Optional) Timestamp when the operation finished, if completed" + "training_config": { + "$ref": "#/components/schemas/TrainingConfig", + "description": "The training configuration." }, - "attributes": { + "hyperparam_search_config": { "type": "object", "additionalProperties": { "oneOf": [ @@ -18968,118 +17762,55 @@ } ] }, - "description": "(Optional) Key-value pairs containing additional metadata about the span" + "description": "The hyperparam search configuration." }, - "status": { - "$ref": "#/components/schemas/SpanStatus", - "description": "(Optional) The current status of the span" - } - }, - "additionalProperties": false, - "required": [ - "span_id", - "trace_id", - "name", - "start_time" - ], - "title": "SpanWithStatus", - "description": "A span that includes status information." - }, - "QuerySpanTreeResponse": { - "type": "object", - "properties": { - "data": { + "logger_config": { "type": "object", "additionalProperties": { - "$ref": "#/components/schemas/SpanWithStatus" - }, - "description": "Dictionary mapping span IDs to spans with status information" - } - }, - "additionalProperties": false, - "required": [ - "data" - ], - "title": "QuerySpanTreeResponse", - "description": "Response containing a tree structure of spans." - }, - "QueryTracesRequest": { - "type": "object", - "properties": { - "attribute_filters": { - "type": "array", - "items": { - "$ref": "#/components/schemas/QueryCondition" - }, - "description": "The attribute filters to apply to the traces." - }, - "limit": { - "type": "integer", - "description": "The limit of traces to return." - }, - "offset": { - "type": "integer", - "description": "The offset of the traces to return." - }, - "order_by": { - "type": "array", - "items": { - "type": "string" + "oneOf": [ + { + "type": "null" + }, + { + "type": "boolean" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "array" + }, + { + "type": "object" + } + ] }, - "description": "The order by of the traces to return." - } - }, - "additionalProperties": false, - "title": "QueryTracesRequest" - }, - "Trace": { - "type": "object", - "properties": { - "trace_id": { - "type": "string", - "description": "Unique identifier for the trace" + "description": "The logger configuration." }, - "root_span_id": { + "model": { "type": "string", - "description": "Unique identifier for the root span that started this trace" + "description": "The model to fine-tune." }, - "start_time": { + "checkpoint_dir": { "type": "string", - "format": "date-time", - "description": "Timestamp when the trace began" + "description": "The directory to save checkpoint(s) to." }, - "end_time": { - "type": "string", - "format": "date-time", - "description": "(Optional) Timestamp when the trace finished, if completed" - } - }, - "additionalProperties": false, - "required": [ - "trace_id", - "root_span_id", - "start_time" - ], - "title": "Trace", - "description": "A trace representing the complete execution path of a request across multiple operations." - }, - "QueryTracesResponse": { - "type": "object", - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Trace" - }, - "description": "List of traces matching the query criteria" + "algorithm_config": { + "$ref": "#/components/schemas/AlgorithmConfig", + "description": "The algorithm configuration." } }, "additionalProperties": false, "required": [ - "data" + "job_uuid", + "training_config", + "hyperparam_search_config", + "logger_config" ], - "title": "QueryTracesResponse", - "description": "Response containing a list of traces." + "title": "SupervisedFineTuneRequest" } }, "responses": { @@ -19232,10 +17963,6 @@ "name": "SyntheticDataGeneration (Coming Soon)", "description": "" }, - { - "name": "Telemetry", - "description": "" - }, { "name": "ToolGroups", "description": "" @@ -19271,7 +17998,6 @@ "ScoringFunctions", "Shields", "SyntheticDataGeneration (Coming Soon)", - "Telemetry", "ToolGroups", "ToolRuntime", "VectorIO" diff --git a/docs/static/stainless-llama-stack-spec.yaml b/docs/static/stainless-llama-stack-spec.yaml index b01779abbe..b28b3d8f75 100644 --- a/docs/static/stainless-llama-stack-spec.yaml +++ b/docs/static/stainless-llama-stack-spec.yaml @@ -1947,33 +1947,6 @@ paths: $ref: '#/components/schemas/SyntheticDataGenerateRequest' required: true deprecated: false - /v1/telemetry/events: - 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: - - Telemetry - summary: Log an event. - description: Log an event. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/LogEventRequest' - required: true - deprecated: false /v1/tool-runtime/invoke: post: responses: @@ -4285,238 +4258,6 @@ paths: $ref: '#/components/schemas/SupervisedFineTuneRequest' required: true deprecated: false - /v1alpha/telemetry/metrics/{metric_name}: - post: - responses: - '200': - description: A QueryMetricsResponse. - content: - application/json: - schema: - $ref: '#/components/schemas/QueryMetricsResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Telemetry - summary: Query metrics. - description: Query metrics. - parameters: - - name: metric_name - in: path - description: The name of the metric to query. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QueryMetricsRequest' - required: true - deprecated: false - /v1alpha/telemetry/spans: - post: - responses: - '200': - description: A QuerySpansResponse. - content: - application/json: - schema: - $ref: '#/components/schemas/QuerySpansResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Telemetry - summary: Query spans. - description: Query spans. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QuerySpansRequest' - required: true - deprecated: false - /v1alpha/telemetry/spans/export: - 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: - - Telemetry - summary: Save spans to a dataset. - description: Save spans to a dataset. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SaveSpansToDatasetRequest' - required: true - deprecated: false - /v1alpha/telemetry/spans/{span_id}/tree: - post: - responses: - '200': - description: A QuerySpanTreeResponse. - content: - application/json: - schema: - $ref: '#/components/schemas/QuerySpanTreeResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Telemetry - summary: Get a span tree by its ID. - description: Get a span tree by its ID. - parameters: - - name: span_id - in: path - description: The ID of the span to get the tree from. - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/GetSpanTreeRequest' - required: true - deprecated: false - /v1alpha/telemetry/traces: - post: - responses: - '200': - description: A QueryTracesResponse. - content: - application/json: - schema: - $ref: '#/components/schemas/QueryTracesResponse' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Telemetry - summary: Query traces. - description: Query traces. - parameters: [] - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/QueryTracesRequest' - required: true - deprecated: false - /v1alpha/telemetry/traces/{trace_id}: - get: - responses: - '200': - description: A Trace. - content: - application/json: - schema: - $ref: '#/components/schemas/Trace' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Telemetry - summary: Get a trace by its ID. - description: Get a trace by its ID. - parameters: - - name: trace_id - in: path - description: The ID of the trace to get. - required: true - schema: - type: string - deprecated: false - /v1alpha/telemetry/traces/{trace_id}/spans/{span_id}: - get: - responses: - '200': - description: A Span. - content: - application/json: - schema: - $ref: '#/components/schemas/Span' - '400': - $ref: '#/components/responses/BadRequest400' - '429': - $ref: >- - #/components/responses/TooManyRequests429 - '500': - $ref: >- - #/components/responses/InternalServerError500 - default: - $ref: '#/components/responses/DefaultError' - tags: - - Telemetry - summary: Get a span by its ID. - description: Get a span by its ID. - parameters: - - name: trace_id - in: path - description: >- - The ID of the trace to get the span from. - required: true - schema: - type: string - - name: span_id - in: path - description: The ID of the span to get. - required: true - schema: - type: string - deprecated: false jsonSchemaDialect: >- https://json-schema.org/draft/2020-12/schema components: @@ -10010,299 +9751,38 @@ components: description: >- Response from the synthetic data generation. Batch of (prompt, response, score) tuples that pass the threshold. - Event: - oneOf: - - $ref: '#/components/schemas/UnstructuredLogEvent' - - $ref: '#/components/schemas/MetricEvent' - - $ref: '#/components/schemas/StructuredLogEvent' - discriminator: - propertyName: type - mapping: - unstructured_log: '#/components/schemas/UnstructuredLogEvent' - metric: '#/components/schemas/MetricEvent' - structured_log: '#/components/schemas/StructuredLogEvent' - EventType: - type: string - enum: - - unstructured_log - - structured_log - - metric - title: EventType - description: >- - The type of telemetry event being logged. - LogSeverity: - type: string - enum: - - verbose - - debug - - info - - warn - - error - - critical - title: LogSeverity - description: The severity level of a log message. - MetricEvent: + InvokeToolRequest: type: object properties: - trace_id: - type: string - description: >- - Unique identifier for the trace this event belongs to - span_id: - type: string - description: >- - Unique identifier for the span this event belongs to - timestamp: + tool_name: type: string - format: date-time - description: Timestamp when the event occurred - attributes: + description: The name of the tool to invoke. + kwargs: type: object additionalProperties: oneOf: - - type: string - - type: integer - - type: number - - type: boolean - type: 'null' + - type: boolean + - type: number + - type: string + - type: array + - type: object description: >- - (Optional) Key-value pairs containing additional metadata about the event - type: - $ref: '#/components/schemas/EventType' - const: metric - default: metric - description: Event type identifier set to METRIC - metric: - type: string - description: The name of the metric being measured - value: - oneOf: - - type: integer - - type: number - description: >- - The numeric value of the metric measurement - unit: - type: string - description: >- - The unit of measurement for the metric value + A dictionary of arguments to pass to the tool. additionalProperties: false required: - - trace_id - - span_id - - timestamp - - type - - metric - - value - - unit - title: MetricEvent - description: >- - A metric event containing a measured value. - SpanEndPayload: + - tool_name + - kwargs + title: InvokeToolRequest + ToolInvocationResult: type: object properties: - type: - $ref: '#/components/schemas/StructuredLogType' - const: span_end - default: span_end - description: Payload type identifier set to SPAN_END - status: - $ref: '#/components/schemas/SpanStatus' + content: + $ref: '#/components/schemas/InterleavedContent' description: >- - The final status of the span indicating success or failure - additionalProperties: false - required: - - type - - status - title: SpanEndPayload - description: Payload for a span end event. - SpanStartPayload: - type: object - properties: - type: - $ref: '#/components/schemas/StructuredLogType' - const: span_start - default: span_start - description: >- - Payload type identifier set to SPAN_START - name: - type: string - description: >- - Human-readable name describing the operation this span represents - parent_span_id: - type: string - description: >- - (Optional) Unique identifier for the parent span, if this is a child span - additionalProperties: false - required: - - type - - name - title: SpanStartPayload - description: Payload for a span start event. - SpanStatus: - type: string - enum: - - ok - - error - title: SpanStatus - description: >- - The status of a span indicating whether it completed successfully or with - an error. - StructuredLogEvent: - type: object - properties: - trace_id: - type: string - description: >- - Unique identifier for the trace this event belongs to - span_id: - type: string - description: >- - Unique identifier for the span this event belongs to - timestamp: - type: string - format: date-time - description: Timestamp when the event occurred - attributes: - type: object - additionalProperties: - oneOf: - - type: string - - type: integer - - type: number - - type: boolean - - type: 'null' - description: >- - (Optional) Key-value pairs containing additional metadata about the event - type: - $ref: '#/components/schemas/EventType' - const: structured_log - default: structured_log - description: >- - Event type identifier set to STRUCTURED_LOG - payload: - oneOf: - - $ref: '#/components/schemas/SpanStartPayload' - - $ref: '#/components/schemas/SpanEndPayload' - discriminator: - propertyName: type - mapping: - span_start: '#/components/schemas/SpanStartPayload' - span_end: '#/components/schemas/SpanEndPayload' - description: >- - The structured payload data for the log event - additionalProperties: false - required: - - trace_id - - span_id - - timestamp - - type - - payload - title: StructuredLogEvent - description: >- - A structured log event containing typed payload data. - StructuredLogType: - type: string - enum: - - span_start - - span_end - title: StructuredLogType - description: >- - The type of structured log event payload. - UnstructuredLogEvent: - type: object - properties: - trace_id: - type: string - description: >- - Unique identifier for the trace this event belongs to - span_id: - type: string - description: >- - Unique identifier for the span this event belongs to - timestamp: - type: string - format: date-time - description: Timestamp when the event occurred - attributes: - type: object - additionalProperties: - oneOf: - - type: string - - type: integer - - type: number - - type: boolean - - type: 'null' - description: >- - (Optional) Key-value pairs containing additional metadata about the event - type: - $ref: '#/components/schemas/EventType' - const: unstructured_log - default: unstructured_log - description: >- - Event type identifier set to UNSTRUCTURED_LOG - message: - type: string - description: The log message text - severity: - $ref: '#/components/schemas/LogSeverity' - description: The severity level of the log message - additionalProperties: false - required: - - trace_id - - span_id - - timestamp - - type - - message - - severity - title: UnstructuredLogEvent - description: >- - An unstructured log event containing a simple text message. - LogEventRequest: - type: object - properties: - event: - $ref: '#/components/schemas/Event' - description: The event to log. - ttl_seconds: - type: integer - description: The time to live of the event. - additionalProperties: false - required: - - event - - ttl_seconds - title: LogEventRequest - InvokeToolRequest: - type: object - properties: - tool_name: - type: string - description: The name of the tool to invoke. - kwargs: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - A dictionary of arguments to pass to the tool. - additionalProperties: false - required: - - tool_name - - kwargs - title: InvokeToolRequest - ToolInvocationResult: - type: object - properties: - content: - $ref: '#/components/schemas/InterleavedContent' - description: >- - (Optional) The output content from the tool execution - error_message: - type: string + (Optional) The output content from the tool execution + error_message: + type: string description: >- (Optional) Error message if the tool execution failed error_code: @@ -13981,425 +13461,6 @@ components: - hyperparam_search_config - logger_config title: SupervisedFineTuneRequest - QueryMetricsRequest: - type: object - properties: - start_time: - type: integer - description: The start time of the metric to query. - end_time: - type: integer - description: The end time of the metric to query. - granularity: - type: string - description: The granularity of the metric to query. - query_type: - type: string - enum: - - range - - instant - description: The type of query to perform. - label_matchers: - type: array - items: - type: object - properties: - name: - type: string - description: The name of the label to match - value: - type: string - description: The value to match against - operator: - type: string - enum: - - '=' - - '!=' - - =~ - - '!~' - description: >- - The comparison operator to use for matching - default: '=' - additionalProperties: false - required: - - name - - value - - operator - title: MetricLabelMatcher - description: >- - A matcher for filtering metrics by label values. - description: >- - The label matchers to apply to the metric. - additionalProperties: false - required: - - start_time - - query_type - title: QueryMetricsRequest - MetricDataPoint: - type: object - properties: - timestamp: - type: integer - description: >- - Unix timestamp when the metric value was recorded - value: - type: number - description: >- - The numeric value of the metric at this timestamp - unit: - type: string - additionalProperties: false - required: - - timestamp - - value - - unit - title: MetricDataPoint - description: >- - A single data point in a metric time series. - MetricLabel: - type: object - properties: - name: - type: string - description: The name of the label - value: - type: string - description: The value of the label - additionalProperties: false - required: - - name - - value - title: MetricLabel - description: A label associated with a metric. - MetricSeries: - type: object - properties: - metric: - type: string - description: The name of the metric - labels: - type: array - items: - $ref: '#/components/schemas/MetricLabel' - description: >- - List of labels associated with this metric series - values: - type: array - items: - $ref: '#/components/schemas/MetricDataPoint' - description: >- - List of data points in chronological order - additionalProperties: false - required: - - metric - - labels - - values - title: MetricSeries - description: A time series of metric data points. - QueryMetricsResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/MetricSeries' - description: >- - List of metric series matching the query criteria - additionalProperties: false - required: - - data - title: QueryMetricsResponse - description: >- - Response containing metric time series data. - QueryCondition: - type: object - properties: - key: - type: string - description: The attribute key to filter on - op: - $ref: '#/components/schemas/QueryConditionOp' - description: The comparison operator to apply - value: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: The value to compare against - additionalProperties: false - required: - - key - - op - - value - title: QueryCondition - description: A condition for filtering query results. - QueryConditionOp: - type: string - enum: - - eq - - ne - - gt - - lt - title: QueryConditionOp - description: >- - Comparison operators for query conditions. - QuerySpansRequest: - type: object - properties: - attribute_filters: - type: array - items: - $ref: '#/components/schemas/QueryCondition' - description: >- - The attribute filters to apply to the spans. - attributes_to_return: - type: array - items: - type: string - description: The attributes to return in the spans. - max_depth: - type: integer - description: The maximum depth of the tree. - additionalProperties: false - required: - - attribute_filters - - attributes_to_return - title: QuerySpansRequest - Span: - type: object - properties: - span_id: - type: string - description: Unique identifier for the span - trace_id: - type: string - description: >- - Unique identifier for the trace this span belongs to - parent_span_id: - type: string - description: >- - (Optional) Unique identifier for the parent span, if this is a child span - name: - type: string - description: >- - Human-readable name describing the operation this span represents - start_time: - type: string - format: date-time - description: Timestamp when the operation began - end_time: - type: string - format: date-time - description: >- - (Optional) Timestamp when the operation finished, if completed - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Key-value pairs containing additional metadata about the span - additionalProperties: false - required: - - span_id - - trace_id - - name - - start_time - title: Span - description: >- - A span representing a single operation within a trace. - QuerySpansResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/Span' - description: >- - List of spans matching the query criteria - additionalProperties: false - required: - - data - title: QuerySpansResponse - description: Response containing a list of spans. - SaveSpansToDatasetRequest: - type: object - properties: - attribute_filters: - type: array - items: - $ref: '#/components/schemas/QueryCondition' - description: >- - The attribute filters to apply to the spans. - attributes_to_save: - type: array - items: - type: string - description: The attributes to save to the dataset. - dataset_id: - type: string - description: >- - The ID of the dataset to save the spans to. - max_depth: - type: integer - description: The maximum depth of the tree. - additionalProperties: false - required: - - attribute_filters - - attributes_to_save - - dataset_id - title: SaveSpansToDatasetRequest - GetSpanTreeRequest: - type: object - properties: - attributes_to_return: - type: array - items: - type: string - description: The attributes to return in the tree. - max_depth: - type: integer - description: The maximum depth of the tree. - additionalProperties: false - title: GetSpanTreeRequest - SpanWithStatus: - type: object - properties: - span_id: - type: string - description: Unique identifier for the span - trace_id: - type: string - description: >- - Unique identifier for the trace this span belongs to - parent_span_id: - type: string - description: >- - (Optional) Unique identifier for the parent span, if this is a child span - name: - type: string - description: >- - Human-readable name describing the operation this span represents - start_time: - type: string - format: date-time - description: Timestamp when the operation began - end_time: - type: string - format: date-time - description: >- - (Optional) Timestamp when the operation finished, if completed - attributes: - type: object - additionalProperties: - oneOf: - - type: 'null' - - type: boolean - - type: number - - type: string - - type: array - - type: object - description: >- - (Optional) Key-value pairs containing additional metadata about the span - status: - $ref: '#/components/schemas/SpanStatus' - description: >- - (Optional) The current status of the span - additionalProperties: false - required: - - span_id - - trace_id - - name - - start_time - title: SpanWithStatus - description: A span that includes status information. - QuerySpanTreeResponse: - type: object - properties: - data: - type: object - additionalProperties: - $ref: '#/components/schemas/SpanWithStatus' - description: >- - Dictionary mapping span IDs to spans with status information - additionalProperties: false - required: - - data - title: QuerySpanTreeResponse - description: >- - Response containing a tree structure of spans. - QueryTracesRequest: - type: object - properties: - attribute_filters: - type: array - items: - $ref: '#/components/schemas/QueryCondition' - description: >- - The attribute filters to apply to the traces. - limit: - type: integer - description: The limit of traces to return. - offset: - type: integer - description: The offset of the traces to return. - order_by: - type: array - items: - type: string - description: The order by of the traces to return. - additionalProperties: false - title: QueryTracesRequest - Trace: - type: object - properties: - trace_id: - type: string - description: Unique identifier for the trace - root_span_id: - type: string - description: >- - Unique identifier for the root span that started this trace - start_time: - type: string - format: date-time - description: Timestamp when the trace began - end_time: - type: string - format: date-time - description: >- - (Optional) Timestamp when the trace finished, if completed - additionalProperties: false - required: - - trace_id - - root_span_id - - start_time - title: Trace - description: >- - A trace representing the complete execution path of a request across multiple - operations. - QueryTracesResponse: - type: object - properties: - data: - type: array - items: - $ref: '#/components/schemas/Trace' - description: >- - List of traces matching the query criteria - additionalProperties: false - required: - - data - title: QueryTracesResponse - description: Response containing a list of traces. responses: BadRequest400: description: The request was invalid or malformed @@ -14513,8 +13574,6 @@ tags: description: '' - name: SyntheticDataGeneration (Coming Soon) description: '' - - name: Telemetry - description: '' - name: ToolGroups description: '' - name: ToolRuntime @@ -14542,7 +13601,6 @@ x-tagGroups: - ScoringFunctions - Shields - SyntheticDataGeneration (Coming Soon) - - Telemetry - ToolGroups - ToolRuntime - VectorIO diff --git a/llama_stack/apis/telemetry/telemetry.py b/llama_stack/apis/telemetry/telemetry.py index 0e772da6a0..b2999ad33e 100644 --- a/llama_stack/apis/telemetry/telemetry.py +++ b/llama_stack/apis/telemetry/telemetry.py @@ -16,15 +16,12 @@ from pydantic import BaseModel, Field -from llama_stack.apis.version import LLAMA_STACK_API_V1, LLAMA_STACK_API_V1ALPHA from llama_stack.models.llama.datatypes import Primitive -from llama_stack.schema_utils import json_schema_type, register_schema, webmethod +from llama_stack.schema_utils import json_schema_type, register_schema # Add this constant near the top of the file, after the imports DEFAULT_TTL_DAYS = 7 -REQUIRED_SCOPE = "telemetry.read" - @json_schema_type class SpanStatus(Enum): @@ -413,7 +410,6 @@ class QueryMetricsResponse(BaseModel): @runtime_checkable class Telemetry(Protocol): - @webmethod(route="/telemetry/events", method="POST", level=LLAMA_STACK_API_V1) async def log_event( self, event: Event, @@ -426,14 +422,6 @@ async def log_event( """ ... - @webmethod( - route="/telemetry/traces", - method="POST", - required_scope=REQUIRED_SCOPE, - deprecated=True, - level=LLAMA_STACK_API_V1, - ) - @webmethod(route="/telemetry/traces", method="POST", required_scope=REQUIRED_SCOPE, level=LLAMA_STACK_API_V1ALPHA) async def query_traces( self, attribute_filters: list[QueryCondition] | None = None, @@ -451,19 +439,6 @@ async def query_traces( """ ... - @webmethod( - route="/telemetry/traces/{trace_id:path}", - method="GET", - required_scope=REQUIRED_SCOPE, - deprecated=True, - level=LLAMA_STACK_API_V1, - ) - @webmethod( - route="/telemetry/traces/{trace_id:path}", - method="GET", - required_scope=REQUIRED_SCOPE, - level=LLAMA_STACK_API_V1ALPHA, - ) async def get_trace(self, trace_id: str) -> Trace: """Get a trace by its ID. @@ -472,19 +447,6 @@ async def get_trace(self, trace_id: str) -> Trace: """ ... - @webmethod( - route="/telemetry/traces/{trace_id:path}/spans/{span_id:path}", - method="GET", - required_scope=REQUIRED_SCOPE, - deprecated=True, - level=LLAMA_STACK_API_V1, - ) - @webmethod( - route="/telemetry/traces/{trace_id:path}/spans/{span_id:path}", - method="GET", - required_scope=REQUIRED_SCOPE, - level=LLAMA_STACK_API_V1ALPHA, - ) async def get_span(self, trace_id: str, span_id: str) -> Span: """Get a span by its ID. @@ -494,19 +456,6 @@ async def get_span(self, trace_id: str, span_id: str) -> Span: """ ... - @webmethod( - route="/telemetry/spans/{span_id:path}/tree", - method="POST", - deprecated=True, - required_scope=REQUIRED_SCOPE, - level=LLAMA_STACK_API_V1, - ) - @webmethod( - route="/telemetry/spans/{span_id:path}/tree", - method="POST", - required_scope=REQUIRED_SCOPE, - level=LLAMA_STACK_API_V1ALPHA, - ) async def get_span_tree( self, span_id: str, @@ -522,14 +471,6 @@ async def get_span_tree( """ ... - @webmethod( - route="/telemetry/spans", - method="POST", - required_scope=REQUIRED_SCOPE, - deprecated=True, - level=LLAMA_STACK_API_V1, - ) - @webmethod(route="/telemetry/spans", method="POST", required_scope=REQUIRED_SCOPE, level=LLAMA_STACK_API_V1ALPHA) async def query_spans( self, attribute_filters: list[QueryCondition], @@ -545,8 +486,6 @@ async def query_spans( """ ... - @webmethod(route="/telemetry/spans/export", method="POST", deprecated=True, level=LLAMA_STACK_API_V1) - @webmethod(route="/telemetry/spans/export", method="POST", level=LLAMA_STACK_API_V1ALPHA) async def save_spans_to_dataset( self, attribute_filters: list[QueryCondition], @@ -563,19 +502,6 @@ async def save_spans_to_dataset( """ ... - @webmethod( - route="/telemetry/metrics/{metric_name}", - method="POST", - required_scope=REQUIRED_SCOPE, - deprecated=True, - level=LLAMA_STACK_API_V1, - ) - @webmethod( - route="/telemetry/metrics/{metric_name}", - method="POST", - required_scope=REQUIRED_SCOPE, - level=LLAMA_STACK_API_V1ALPHA, - ) async def query_metrics( self, metric_name: str, diff --git a/tests/integration/telemetry/recordings/0de60cd6a6ec3dbfc4a7601e77be8083caf34f49147ad1c25efae1de3f0b25e5.json b/tests/integration/telemetry/recordings/0de60cd6a6ec3dbfc4a7601e77be8083caf34f49147ad1c25efae1de3f0b25e5.json deleted file mode 100644 index 427e0295ba..0000000000 --- a/tests/integration/telemetry/recordings/0de60cd6a6ec3dbfc4a7601e77be8083caf34f49147ad1c25efae1de3f0b25e5.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "test_id": "tests/integration/telemetry/test_openai_telemetry.py::test_openai_completion_creates_telemetry[txt=ollama/llama3.2:3b-instruct-fp16]", - "request": { - "method": "POST", - "url": "http://0.0.0.0:11434/v1/v1/chat/completions", - "headers": {}, - "body": { - "model": "llama3.2:3b-instruct-fp16", - "messages": [ - { - "role": "user", - "content": "Test OpenAI telemetry creation" - } - ], - "stream": false - }, - "endpoint": "/v1/chat/completions", - "model": "llama3.2:3b-instruct-fp16" - }, - "response": { - "body": { - "__type__": "openai.types.chat.chat_completion.ChatCompletion", - "__data__": { - "id": "rec-0de60cd6a6ec", - "choices": [ - { - "finish_reason": "stop", - "index": 0, - "logprobs": null, - "message": { - "content": "I'm happy to help you test this! This type of model is designed to provide information and answer questions, rather than engage in conversation or generate creative content. Feel free to ask me anything or test out any features you'd like. I'll do my best to assist you.\r\n\r\nIf you're looking for a way to engage with the model more creatively, there are several things you could try:\r\n\r\n1. Ask me a question on a topic unrelated to the ones I was trained on. This can give me a chance to demonstrate my ability to learn and generalize.\r\n2. Ask me to generate a piece of content - such as a short story or poem - on a specific topic. I can use patterns in the data I was trained on to generate text that is similar in style and structure to what you might find in a published book or article.\r\n3. Play a game with me. We could play games like \"20 Questions\" (where you think of an object, and I try to guess what it is by asking yes-or-no questions), or \"Hangman\". Let me know if there's something else you'd like to do!", - "refusal": null, - "role": "assistant", - "annotations": null, - "audio": null, - "function_call": null, - "tool_calls": null - } - } - ], - "created": 0, - "model": "llama3.2:3b-instruct-fp16", - "object": "chat.completion", - "service_tier": null, - "system_fingerprint": "fp_ollama", - "usage": { - "completion_tokens": 229, - "prompt_tokens": 30, - "total_tokens": 259, - "completion_tokens_details": null, - "prompt_tokens_details": null - } - } - }, - "is_streaming": false - } -} diff --git a/tests/integration/telemetry/test_openai_telemetry.py b/tests/integration/telemetry/test_openai_telemetry.py deleted file mode 100644 index b3ffb6b090..0000000000 --- a/tests/integration/telemetry/test_openai_telemetry.py +++ /dev/null @@ -1,194 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -import time -from datetime import UTC, datetime - -import pytest - - -@pytest.fixture(scope="module", autouse=True) -def setup_openai_telemetry_data(llama_stack_client, text_model_id): - """Setup fixture that creates telemetry data specifically for OpenAI completions testing.""" - - # Create OpenAI completion traces - for i in range(3): - llama_stack_client.chat.completions.create( - model=text_model_id, - messages=[ - { - "role": "user", - "content": f"Test trace openai {i}", - } - ], - # stream=False to always capture Metrics. - stream=False, - ) - - # Create additional OpenAI completion traces with different parameters - for i in range(2): - llama_stack_client.chat.completions.create( - model=text_model_id, - messages=[ - { - "role": "user", - "content": f"Test trace openai with temperature {i}", - } - ], - temperature=0.7, - max_tokens=100, - stream=False, - ) - - start_time = time.time() - - while time.time() - start_time < 30: - traces = llama_stack_client.telemetry.query_traces(limit=10) - if len(traces) >= 5: # 5 OpenAI completion traces - break - time.sleep(0.1) - - if len(traces) < 5: - pytest.fail( - f"Failed to create sufficient OpenAI completion telemetry data after 30s. Got {len(traces)} traces." - ) - - yield - - -def test_openai_traces_basic(llama_stack_client): - """Test basic trace querying functionality for OpenAI completions.""" - all_traces = llama_stack_client.telemetry.query_traces(limit=10) - - assert isinstance(all_traces, list), "Should return a list of traces" - assert len(all_traces) >= 5, "Should have at least 5 traces from OpenAI setup" - - # Verify trace structure and data quality - first_trace = all_traces[0] - assert hasattr(first_trace, "trace_id"), "Trace should have trace_id" - assert hasattr(first_trace, "start_time"), "Trace should have start_time" - assert hasattr(first_trace, "root_span_id"), "Trace should have root_span_id" - - # Validate trace_id is a valid UUID format - assert isinstance(first_trace.trace_id, str) and len(first_trace.trace_id) > 0, ( - "trace_id should be non-empty string" - ) - - # Validate start_time format and not in the future - now = datetime.now(UTC) - if isinstance(first_trace.start_time, str): - trace_time = datetime.fromisoformat(first_trace.start_time.replace("Z", "+00:00")) - else: - # start_time is already a datetime object - trace_time = first_trace.start_time - if trace_time.tzinfo is None: - trace_time = trace_time.replace(tzinfo=UTC) - - # Ensure trace time is not in the future - time_diff = (now - trace_time).total_seconds() - assert time_diff >= 0, f"Trace start_time should not be in the future, got {time_diff}s" - - # Validate root_span_id exists and is non-empty - assert isinstance(first_trace.root_span_id, str) and len(first_trace.root_span_id) > 0, ( - "root_span_id should be non-empty string" - ) - - # Test querying specific trace by ID - specific_trace = llama_stack_client.telemetry.get_trace(trace_id=first_trace.trace_id) - assert specific_trace.trace_id == first_trace.trace_id, "Retrieved trace should match requested ID" - assert specific_trace.start_time == first_trace.start_time, "Retrieved trace should have same start_time" - assert specific_trace.root_span_id == first_trace.root_span_id, "Retrieved trace should have same root_span_id" - - # Test pagination with proper validation - recent_traces = llama_stack_client.telemetry.query_traces(limit=3, offset=0) - assert len(recent_traces) <= 3, "Should return at most 3 traces when limit=3" - assert len(recent_traces) >= 1, "Should return at least 1 trace" - - # Verify all traces have required fields - for trace in recent_traces: - assert hasattr(trace, "trace_id") and trace.trace_id, "Each trace should have non-empty trace_id" - assert hasattr(trace, "start_time") and trace.start_time, "Each trace should have non-empty start_time" - assert hasattr(trace, "root_span_id") and trace.root_span_id, "Each trace should have non-empty root_span_id" - - -def test_openai_spans_basic(llama_stack_client): - """Test basic span querying functionality for OpenAI completions.""" - spans = llama_stack_client.telemetry.query_spans(attribute_filters=[], attributes_to_return=[]) - - assert isinstance(spans, list), "Should return a list of spans" - assert len(spans) >= 1, "Should have at least one span from OpenAI setup" - - # Verify span structure and data quality - first_span = spans[0] - required_attrs = ["span_id", "name", "trace_id"] - for attr in required_attrs: - assert hasattr(first_span, attr), f"Span should have {attr} attribute" - assert getattr(first_span, attr), f"Span {attr} should not be empty" - - # Validate span data types and content - assert isinstance(first_span.span_id, str) and len(first_span.span_id) > 0, "span_id should be non-empty string" - assert isinstance(first_span.name, str) and len(first_span.name) > 0, "span name should be non-empty string" - assert isinstance(first_span.trace_id, str) and len(first_span.trace_id) > 0, "trace_id should be non-empty string" - - # Verify span belongs to a valid trace - all_traces = llama_stack_client.telemetry.query_traces(limit=10) - trace_ids = {t.trace_id for t in all_traces} - if first_span.trace_id in trace_ids: - trace = llama_stack_client.telemetry.get_trace(trace_id=first_span.trace_id) - assert trace is not None, "Should be able to retrieve trace for valid trace_id" - assert trace.trace_id == first_span.trace_id, "Trace ID should match span's trace_id" - - # Test with span filtering and validate results - filtered_spans = llama_stack_client.telemetry.query_spans( - attribute_filters=[{"key": "name", "op": "eq", "value": first_span.name}], - attributes_to_return=["name", "span_id"], - ) - assert isinstance(filtered_spans, list), "Should return a list with span name filter" - - # Validate filtered spans if filtering works - if len(filtered_spans) > 0: - for span in filtered_spans: - assert hasattr(span, "name"), "Filtered spans should have name attribute" - assert hasattr(span, "span_id"), "Filtered spans should have span_id attribute" - assert span.name == first_span.name, "Filtered spans should match the filter criteria" - assert isinstance(span.span_id, str) and len(span.span_id) > 0, "Filtered span_id should be valid" - - # Test that all spans have consistent structure - for span in spans: - for attr in required_attrs: - assert hasattr(span, attr) and getattr(span, attr), f"All spans should have non-empty {attr}" - - -def test_openai_completion_creates_telemetry(llama_stack_client, text_model_id): - """Test that making OpenAI completion calls actually creates telemetry data.""" - - # Get initial trace count - initial_traces = llama_stack_client.telemetry.query_traces(limit=20) - initial_count = len(initial_traces) - - # Make a new OpenAI completion call - response = llama_stack_client.chat.completions.create( - model=text_model_id, - messages=[{"role": "user", "content": "Test OpenAI telemetry creation"}], - stream=False, - ) - - # Verify we got a response - assert response is not None, "Should get a response from OpenAI completion" - assert hasattr(response, "choices"), "Response should have choices" - assert len(response.choices) > 0, "Response should have at least one choice" - - # Wait for telemetry to be recorded - start_time = time.time() - while time.time() - start_time < 30: - final_traces = llama_stack_client.telemetry.query_traces(limit=20) - final_count = len(final_traces) - if final_count > initial_count: - break - time.sleep(0.1) - - # Should have at least as many traces as before (might have more due to other activity) - assert final_count >= initial_count, "Should have at least as many traces after OpenAI call" diff --git a/tests/integration/telemetry/test_telemetry.py b/tests/integration/telemetry/test_telemetry.py deleted file mode 100644 index aff337e354..0000000000 --- a/tests/integration/telemetry/test_telemetry.py +++ /dev/null @@ -1,187 +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 time -from datetime import UTC, datetime -from uuid import uuid4 - -import pytest -from llama_stack_client import Agent - - -@pytest.fixture(scope="module", autouse=True) -def setup_telemetry_data(llama_stack_client, text_model_id): - """Setup fixture that creates telemetry data before tests run.""" - agent = Agent(llama_stack_client, model=text_model_id, instructions="You are a helpful assistant") - - session_id = agent.create_session(f"test-setup-session-{uuid4()}") - - messages = [ - "What is 2 + 2?", - "Tell me a short joke", - ] - - for msg in messages: - agent.create_turn( - messages=[{"role": "user", "content": msg}], - session_id=session_id, - stream=False, - ) - - for i in range(2): - llama_stack_client.chat.completions.create( - model=text_model_id, messages=[{"role": "user", "content": f"Test trace {i}"}] - ) - - start_time = time.time() - - while time.time() - start_time < 30: - traces = llama_stack_client.telemetry.query_traces(limit=10) - if len(traces) >= 4: - break - time.sleep(0.1) - - if len(traces) < 4: - pytest.fail(f"Failed to create sufficient telemetry data after 30s. Got {len(traces)} traces.") - - yield - - -def test_query_traces_basic(llama_stack_client): - """Test basic trace querying functionality with proper data validation.""" - all_traces = llama_stack_client.telemetry.query_traces(limit=5) - - assert isinstance(all_traces, list), "Should return a list of traces" - assert len(all_traces) >= 4, "Should have at least 4 traces from setup" - - # Verify trace structure and data quality - first_trace = all_traces[0] - assert hasattr(first_trace, "trace_id"), "Trace should have trace_id" - assert hasattr(first_trace, "start_time"), "Trace should have start_time" - assert hasattr(first_trace, "root_span_id"), "Trace should have root_span_id" - - # Validate trace_id is a valid UUID format - assert isinstance(first_trace.trace_id, str) and len(first_trace.trace_id) > 0, ( - "trace_id should be non-empty string" - ) - - # Validate start_time format and not in the future - now = datetime.now(UTC) - if isinstance(first_trace.start_time, str): - trace_time = datetime.fromisoformat(first_trace.start_time.replace("Z", "+00:00")) - else: - # start_time is already a datetime object - trace_time = first_trace.start_time - if trace_time.tzinfo is None: - trace_time = trace_time.replace(tzinfo=UTC) - - # Ensure trace time is not in the future (but allow any age in the past for persistent test data) - time_diff = (now - trace_time).total_seconds() - assert time_diff >= 0, f"Trace start_time should not be in the future, got {time_diff}s" - - # Validate root_span_id exists and is non-empty - assert isinstance(first_trace.root_span_id, str) and len(first_trace.root_span_id) > 0, ( - "root_span_id should be non-empty string" - ) - - # Test querying specific trace by ID - specific_trace = llama_stack_client.telemetry.get_trace(trace_id=first_trace.trace_id) - assert specific_trace.trace_id == first_trace.trace_id, "Retrieved trace should match requested ID" - assert specific_trace.start_time == first_trace.start_time, "Retrieved trace should have same start_time" - assert specific_trace.root_span_id == first_trace.root_span_id, "Retrieved trace should have same root_span_id" - - # Test pagination with proper validation - recent_traces = llama_stack_client.telemetry.query_traces(limit=3, offset=0) - assert len(recent_traces) <= 3, "Should return at most 3 traces when limit=3" - assert len(recent_traces) >= 1, "Should return at least 1 trace" - - # Verify all traces have required fields - for trace in recent_traces: - assert hasattr(trace, "trace_id") and trace.trace_id, "Each trace should have non-empty trace_id" - assert hasattr(trace, "start_time") and trace.start_time, "Each trace should have non-empty start_time" - assert hasattr(trace, "root_span_id") and trace.root_span_id, "Each trace should have non-empty root_span_id" - - -def test_query_spans_basic(llama_stack_client): - """Test basic span querying functionality with proper validation.""" - spans = llama_stack_client.telemetry.query_spans(attribute_filters=[], attributes_to_return=[]) - - assert isinstance(spans, list), "Should return a list of spans" - assert len(spans) >= 1, "Should have at least one span from setup" - - # Verify span structure and data quality - first_span = spans[0] - required_attrs = ["span_id", "name", "trace_id"] - for attr in required_attrs: - assert hasattr(first_span, attr), f"Span should have {attr} attribute" - assert getattr(first_span, attr), f"Span {attr} should not be empty" - - # Validate span data types and content - assert isinstance(first_span.span_id, str) and len(first_span.span_id) > 0, "span_id should be non-empty string" - assert isinstance(first_span.name, str) and len(first_span.name) > 0, "span name should be non-empty string" - assert isinstance(first_span.trace_id, str) and len(first_span.trace_id) > 0, "trace_id should be non-empty string" - - # Verify span belongs to a valid trace (test with traces we know exist) - all_traces = llama_stack_client.telemetry.query_traces(limit=10) - trace_ids = {t.trace_id for t in all_traces} - if first_span.trace_id in trace_ids: - trace = llama_stack_client.telemetry.get_trace(trace_id=first_span.trace_id) - assert trace is not None, "Should be able to retrieve trace for valid trace_id" - assert trace.trace_id == first_span.trace_id, "Trace ID should match span's trace_id" - - # Test with span filtering and validate results - filtered_spans = llama_stack_client.telemetry.query_spans( - attribute_filters=[{"key": "name", "op": "eq", "value": first_span.name}], - attributes_to_return=["name", "span_id"], - ) - assert isinstance(filtered_spans, list), "Should return a list with span name filter" - - # Validate filtered spans if filtering works - if len(filtered_spans) > 0: - for span in filtered_spans: - assert hasattr(span, "name"), "Filtered spans should have name attribute" - assert hasattr(span, "span_id"), "Filtered spans should have span_id attribute" - assert span.name == first_span.name, "Filtered spans should match the filter criteria" - assert isinstance(span.span_id, str) and len(span.span_id) > 0, "Filtered span_id should be valid" - - # Test that all spans have consistent structure - for span in spans: - for attr in required_attrs: - assert hasattr(span, attr) and getattr(span, attr), f"All spans should have non-empty {attr}" - - -def test_telemetry_pagination(llama_stack_client): - """Test pagination in telemetry queries.""" - # Get total count of traces - all_traces = llama_stack_client.telemetry.query_traces(limit=20) - total_count = len(all_traces) - assert total_count >= 4, "Should have at least 4 traces from setup" - - # Test trace pagination - page1 = llama_stack_client.telemetry.query_traces(limit=2, offset=0) - page2 = llama_stack_client.telemetry.query_traces(limit=2, offset=2) - - assert len(page1) == 2, "First page should have exactly 2 traces" - assert len(page2) >= 1, "Second page should have at least 1 trace" - - # Verify no overlap between pages - page1_ids = {t.trace_id for t in page1} - page2_ids = {t.trace_id for t in page2} - assert len(page1_ids.intersection(page2_ids)) == 0, "Pages should contain different traces" - - # Test ordering - ordered_traces = llama_stack_client.telemetry.query_traces(limit=5, order_by=["start_time"]) - assert len(ordered_traces) >= 4, "Should have at least 4 traces for ordering test" - - # Verify ordering by start_time - for i in range(len(ordered_traces) - 1): - current_time = ordered_traces[i].start_time - next_time = ordered_traces[i + 1].start_time - assert current_time <= next_time, f"Traces should be ordered by start_time: {current_time} > {next_time}" - - # Test limit behavior - limited = llama_stack_client.telemetry.query_traces(limit=3) - assert len(limited) == 3, "Should return exactly 3 traces when limit=3" diff --git a/tests/integration/telemetry/test_telemetry_metrics.py b/tests/integration/telemetry/test_telemetry_metrics.py deleted file mode 100644 index 1d8312ae21..0000000000 --- a/tests/integration/telemetry/test_telemetry_metrics.py +++ /dev/null @@ -1,206 +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 time -from datetime import UTC, datetime, timedelta - -import pytest - - -@pytest.fixture(scope="module", autouse=True) -def setup_telemetry_metrics_data(openai_client, client_with_models, text_model_id): - """Setup fixture that creates telemetry metrics data before tests run.""" - - # Skip OpenAI tests if running in library mode - if not hasattr(client_with_models, "base_url"): - pytest.skip("OpenAI client tests not supported with library client") - - prompt_tokens = [] - completion_tokens = [] - total_tokens = [] - - # Create OpenAI completions to generate metrics using the proper OpenAI client - for i in range(5): - response = openai_client.chat.completions.create( - model=text_model_id, - messages=[{"role": "user", "content": f"OpenAI test {i}"}], - stream=False, - ) - prompt_tokens.append(response.usage.prompt_tokens) - completion_tokens.append(response.usage.completion_tokens) - total_tokens.append(response.usage.total_tokens) - - # Wait for metrics to be logged - start_time = time.time() - while time.time() - start_time < 30: - try: - # Try to query metrics to see if they're available - metrics_response = client_with_models.telemetry.query_metrics( - metric_name="completion_tokens", - start_time=int((datetime.now(UTC) - timedelta(minutes=5)).timestamp()), - ) - if len(metrics_response[0].values) > 0: - break - except Exception: - pass - time.sleep(0.1) - - # Return the token lists for use in tests - return {"prompt_tokens": prompt_tokens, "completion_tokens": completion_tokens, "total_tokens": total_tokens} - - -@pytest.mark.skip(reason="Skipping this test until client is regenerated") -def test_query_metrics_prompt_tokens(client_with_models, text_model_id, setup_telemetry_metrics_data): - """Test that prompt_tokens metrics are queryable.""" - start_time = int((datetime.now(UTC) - timedelta(minutes=10)).timestamp()) - - response = client_with_models.telemetry.query_metrics( - metric_name="prompt_tokens", - start_time=start_time, - ) - - assert isinstance(response, list) - - assert isinstance(response[0].values, list), "Should return a list of metric series" - - assert response[0].metric == "prompt_tokens" - - # Use the actual values from setup instead of hardcoded values - expected_values = setup_telemetry_metrics_data["prompt_tokens"] - assert response[0].values[-1].value in expected_values, ( - f"Expected one of {expected_values}, got {response[0].values[-1].value}" - ) - - -@pytest.mark.skip(reason="Skipping this test until client is regenerated") -def test_query_metrics_completion_tokens(client_with_models, text_model_id, setup_telemetry_metrics_data): - """Test that completion_tokens metrics are queryable.""" - start_time = int((datetime.now(UTC) - timedelta(minutes=10)).timestamp()) - - response = client_with_models.telemetry.query_metrics( - metric_name="completion_tokens", - start_time=start_time, - ) - - assert isinstance(response, list) - - assert isinstance(response[0].values, list), "Should return a list of metric series" - - assert response[0].metric == "completion_tokens" - - # Use the actual values from setup instead of hardcoded values - expected_values = setup_telemetry_metrics_data["completion_tokens"] - assert response[0].values[-1].value in expected_values, ( - f"Expected one of {expected_values}, got {response[0].values[-1].value}" - ) - - -@pytest.mark.skip(reason="Skipping this test until client is regenerated") -def test_query_metrics_total_tokens(client_with_models, text_model_id, setup_telemetry_metrics_data): - """Test that total_tokens metrics are queryable.""" - start_time = int((datetime.now(UTC) - timedelta(minutes=10)).timestamp()) - - response = client_with_models.telemetry.query_metrics( - metric_name="total_tokens", - start_time=start_time, - ) - - assert isinstance(response, list) - - assert isinstance(response[0].values, list), "Should return a list of metric series" - - assert response[0].metric == "total_tokens" - - # Use the actual values from setup instead of hardcoded values - expected_values = setup_telemetry_metrics_data["total_tokens"] - assert response[0].values[-1].value in expected_values, ( - f"Expected one of {expected_values}, got {response[0].values[-1].value}" - ) - - -@pytest.mark.skip(reason="Skipping this test until client is regenerated") -def test_query_metrics_with_time_range(llama_stack_client, text_model_id): - """Test that metrics are queryable with time range.""" - end_time = int(datetime.now(UTC).timestamp()) - start_time = end_time - 600 # 10 minutes ago - - response = llama_stack_client.telemetry.query_metrics( - metric_name="prompt_tokens", - start_time=start_time, - end_time=end_time, - ) - - assert isinstance(response, list) - - assert isinstance(response[0].values, list), "Should return a list of metric series" - - assert response[0].metric == "prompt_tokens" - - -@pytest.mark.skip(reason="Skipping this test until client is regenerated") -def test_query_metrics_with_label_matchers(llama_stack_client, text_model_id): - """Test that metrics are queryable with label matchers.""" - start_time = int((datetime.now(UTC) - timedelta(minutes=10)).timestamp()) - - response = llama_stack_client.telemetry.query_metrics( - metric_name="prompt_tokens", - start_time=start_time, - label_matchers=[{"name": "model_id", "value": text_model_id, "operator": "="}], - ) - - assert isinstance(response[0].values, list), "Should return a list of metric series" - - -@pytest.mark.skip(reason="Skipping this test until client is regenerated") -def test_query_metrics_nonexistent_metric(llama_stack_client): - """Test that querying a nonexistent metric returns empty data.""" - start_time = int((datetime.now(UTC) - timedelta(minutes=10)).timestamp()) - - response = llama_stack_client.telemetry.query_metrics( - metric_name="nonexistent_metric", - start_time=start_time, - ) - - assert isinstance(response, list), "Should return an empty list for nonexistent metric" - assert len(response) == 0 - - -@pytest.mark.skip(reason="Skipping this test until client is regenerated") -def test_query_metrics_with_granularity(llama_stack_client, text_model_id): - """Test that metrics are queryable with different granularity levels.""" - start_time = int((datetime.now(UTC) - timedelta(minutes=10)).timestamp()) - - # Test hourly granularity - hourly_response = llama_stack_client.telemetry.query_metrics( - metric_name="total_tokens", - start_time=start_time, - granularity="1h", - ) - - # Test daily granularity - daily_response = llama_stack_client.telemetry.query_metrics( - metric_name="total_tokens", - start_time=start_time, - granularity="1d", - ) - - # Test no granularity (raw data points) - raw_response = llama_stack_client.telemetry.query_metrics( - metric_name="total_tokens", - start_time=start_time, - granularity=None, - ) - - # All should return valid data - assert isinstance(hourly_response[0].values, list), "Hourly granularity should return data" - assert isinstance(daily_response[0].values, list), "Daily granularity should return data" - assert isinstance(raw_response[0].values, list), "No granularity should return data" - - # Verify that different granularities produce different aggregation levels - # (The exact number depends on data distribution, but they should be queryable) - assert len(hourly_response[0].values) >= 0, "Hourly granularity should be queryable" - assert len(daily_response[0].values) >= 0, "Daily granularity should be queryable" - assert len(raw_response[0].values) >= 0, "No granularity should be queryable"